Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Load subreport dynamically Post Reply Post New Topic
Author Message
rocky20
Newbie
Newbie


Joined: 07 Nov 2007
Online Status: Offline
Posts: 4
Quote rocky20 Replybullet Topic: Load subreport dynamically
    Posted: 07 Nov 2007 at 2:56am
Hi is there any way that i can load subreport in runtime.
I have one main report on which i would like to load different subreport.
this subreport can choose end user throug parameter or something else
If i can programatically set subreport filepath, or filename or somehow else dynamically set which subreport will be shown, that would be great.
thanks for help
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 07 Nov 2007 at 1:19pm

I am not certain you can call a subreport that is not part of the main report. My understanding is that the main report acts as a container for the subreports.  I am not aware you have the abililty to set a subreport path in code.  

As a fall back, what you might do is create subreports and then suppress them until needed. If you have a large report and need a lot of subreports the performance could be impacted.
 
You might also look at the dynamic subreport features, where the subreport does not run/show until its link is clicked. I dont know if this opens up a way to dynamically change the reports.
 
Sorry I can not be of more help.  Perhaps others will have better solutions.
 
Regards,
 
John W.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 07 Nov 2007 at 1:42pm
I haven't done this before, but if you have CR R2 Developer, then you can add subreports dynamically with the report document object object. This is part of the new licensing that comes with R2 Dev. I suggest downloading the 30 day trial version and testing that out before making a purchases.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.