Wrox Programmer Forums
|
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 5th, 2010, 05:41 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default Reports with more than 1 subreport

Anyone have an idea of how to handle reports with multiple subreports?

The code can only handle one. What can be done to handle more than one?

I can get it to work, just using the page to generate the report works, the report query doenst. Any ideas?
 
Old January 8th, 2010, 02:18 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

So I was thinking along the lines of being able to handle this with a while loop.
Anyone have any forethought on pros/cons before I get started.

Thanks

Code:

if (report.Subreports.Count > 0)
{
//Only support 1 subreport
//Get the object that can retrieve the data for the subreport 
Type objectType1 = Type.GetType(currentReport.SubReportObjectName);
//The methods must be static for this data. 
//To fix need to loop through Method field and build report.Subreports Array....
object[] subreportData = (object[])objectType1.InvokeMember(currentReport.SubReportMethodName, BindingFlags.InvokeMethod, null, objectType1, newobject[] { });
report.Subreports[0].SetDataSource(subreportData);
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
subreport srnarla Crystal Reports 1 August 31st, 2006 10:48 AM
subreport bib Visual Basic 2005 Basics 0 August 25th, 2006 12:56 AM
Crystal Reports SubReport rln Crystal Reports 3 March 17th, 2006 11:55 AM
A subreport cannot contain a subreport. dkells Crystal Reports 0 March 3rd, 2005 06:05 PM
Subreport for CR9 giving empty fields in reports yblee Crystal Reports 0 August 18th, 2004 10:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.