Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: not to refresh subreports Post Reply Post New Topic
Author Message
lozeba
Newbie
Newbie


Joined: 18 Apr 2010
Location: Bahamas
Online Status: Offline
Posts: 4
Quote lozeba Replybullet Topic: not to refresh subreports
     Posted: 05 May 2010 at 4:16am
Hello,
 
I have a main report that contains several subreports on different pages.
When I preview the main report, all the subreports are produced and each time I go on the next page, the subreports are refreshed and I want them just to be displayed (not refreshed).
 
How to do that?
 
Thank you
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 05 May 2010 at 12:15pm
What type of sections are the subreports in?  How are they linked to your main report?
 
-Dell
IP IP Logged
lozeba
Newbie
Newbie


Joined: 18 Apr 2010
Location: Bahamas
Online Status: Offline
Posts: 4
Quote lozeba Replybullet Posted: 05 May 2010 at 2:22pm
They are in details section. They are linked by a primary key
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 06 May 2010 at 3:42am
Here's how subreports work - The sub-report query DOES NOT pull all of the data and cache it in memory to filter for each time a subreport is rendered, instead the query is run with the filter on the where clause EVERY TIME the subreport is rendered.  So, if you're not using the "Page N of M" or "Total Page Count" special fields, what you're seeing is the subreport runs for every section it's in on the page that's being shown.  When you move to another page, it runs again for every section it's in on this new page.
 
If you're using "Page N of M" or "Total Page Count", the queries may get run twice for each.  The first time when you initially run or refresh the report because each page has to be rendered in order for Crystal to know how many pages there are and possibly the second time when the page is displayed.
 
So, unless it's absolutely unavoidable, you have a small result set, or you're placing the subreport in a non-details section that doesn't appear many times on a report, it's best to find a way around using a subreport.  If there's no way to do what you need to without a subreport in the details, you need to be prepared to deal with the way they slow down your report.
 
-Dell
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