Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Detail sections repeat with Chart Post Reply Post New Topic
Author Message
mhackel
Newbie
Newbie


Joined: 04 Aug 2009
Location: United States
Online Status: Offline
Posts: 4
Quote mhackel Replybullet Topic: Detail sections repeat with Chart
     Posted: 04 Aug 2009 at 10:22am
Hi,
I have a report that contains multiple detail sections each with a different subreport.  They all work fine until I add a chart into the report header, then they duplicate many times.  I go from 3 pages to 93 pages. Why?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Aug 2009 at 11:20am

Do you have more than one table (or other data source type) in your report?

If so, without the chart are you using fields ffrom all of your tables?
Does the chart use a field from one of the tables that was previously "dormant"?
IP IP Logged
mhackel
Newbie
Newbie


Joined: 04 Aug 2009
Location: United States
Online Status: Offline
Posts: 4
Quote mhackel Replybullet Posted: 04 Aug 2009 at 11:29am
MS Access is my data source, for now, will move to SQL later. 
 
I am using the same table for all my subreports and a query for the chart. The chart is a summarized view of what is in the subreports. Without the chart the data is all coming from the table.  The chart does not directly use the data from within the table, but the same values are in the query that in the chart.
 
I hope I explain that well enough.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Aug 2009 at 11:44am

Gotcha.

You had NO data or select statement in your main report and you are NOT linking the sub reports to the main report in any way.
Once you addanything to the Main report it will draw one detail row per record from the source data making your sub reports repeat over and over and kill your performance.
Since you are not linking these, move your sub reports to the Report Footer or Header. Add one report per header or footer section (insert as many new extra footers or headers as you need).
Suppress your details section.
IP IP Logged
mhackel
Newbie
Newbie


Joined: 04 Aug 2009
Location: United States
Online Status: Offline
Posts: 4
Quote mhackel Replybullet Posted: 05 Aug 2009 at 6:28am
Thanks, I tried it and it worked great! I never thought to put it in the footer.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Aug 2009 at 6:34am

Glad it worked...   Thumbs%20Up

Generally you only want sub reports in a detail section if that is the only palce they can be for the report to work correctly. Sub reports hit the DB each time they run and when they are on detail sections they can kill performance because you can have it fetching data literally thousands of times.
IP IP Logged
mhackel
Newbie
Newbie


Joined: 04 Aug 2009
Location: United States
Online Status: Offline
Posts: 4
Quote mhackel Replybullet Posted: 05 Aug 2009 at 6:37am
Thanks for the tip, I will remember that! I don't write many sub-reports.
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