Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: subreports Post Reply Post New Topic
Author Message
chad portman
Newbie
Newbie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 4
Quote chad portman Replybullet Topic: subreports
     Posted: 01 Oct 2012 at 7:11am
Is there a way i can make a subreport but supress it so you do not see it or hide it however you need to do it so you do not see the data? Also is there a way to link the subreport to the main report?
 
The final idea i want is that the main report shows all its normal data plus one column from the subreport while the rest of the subreport is hidden. The reason i can not just add that column to the main report is i need to filter the data differently but i want to display both sets of data.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2012 at 7:26am
just add the subreport as the size of the field you want to display on the section you want to display it.
You can suppress sub reports but if you suppress them that do not run. there are tricks around it if needed.
You can link them and/or you can also shared variables back and forth.
IP IP Logged
chad portman
Newbie
Newbie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 4
Quote chad portman Replybullet Posted: 01 Oct 2012 at 10:13am

Ok i added the subreport as the size of the field i wanted to display like you said. It appears to work verifying data now. However it seems to have dramatically increased the run time and the export time. Any ideas why or how to fix?

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 01 Oct 2012 at 10:22am
It dramatically increases the runtime because every time the subreport is run (I'm assuming for each record in your case) the subreport connects to the database and runs a query - so you get the overhead of all of these extra connections and queries.
 
The only way around this might be to write a stored procedure or a Crystal Command (SQL Select Statement) that would pull ALL of the data for your report, including the data that's now in the subreport.  Whether you can do that will depend on your SQL skills and, for the stored proc, whether your DBA will let you do that.
 
-Dell
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2012 at 10:23am

A sub report runs and calls the data once perinstance that it appears on the report. They are horribly inefficient and IMO should only be used if no other option exists or if they are being run at a gheader level so it only calls it once or once per group.

IP IP Logged
chad portman
Newbie
Newbie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 4
Quote chad portman Replybullet Posted: 01 Oct 2012 at 11:09am
Ok so yea subreport is not going to help me get done what i want in a timely manner. So is there another option to get to fields of data from the same table but filtered different from each other?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2012 at 11:16am
you can expand the data set with a more complex select statment or maybe you can join the table to itself using different select statements or maybe you can write a SQL query or comman dobject that gets that data as you need it.
 
IP IP Logged
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