Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Report takes more than 1 hour to run Post Reply Post New Topic
Author Message
asma
Newbie
Newbie


Joined: 12 Apr 2009
Location: United Arab Emirates
Online Status: Offline
Posts: 4
Quote asma Replybullet Topic: Report takes more than 1 hour to run
     Posted: 16 Apr 2009 at 4:19am
 
Hi All
 
  I created a report which takes more than 1 hour to run. It has 1 subreport which has sql expressions. it returns the values to the specified group in the main report, (simply placed no shared variables). but the subreport as well as the main report has sql expressions. any specific way to fine tune this.
 
Any input will be helpful
 
Thanks in advance
 
must say 1 of the best forums.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 Apr 2009 at 5:04am

you could try rewriting the main reports sql so include the information that the subreport uses, and then format the report so that it gives you what is needed without using the subreport.

If it is possible of course, but in most cases, it is.  Why it is taking so long, probably, is that the for every item in the main report, the subreport is being called.  If you have 100 items, that is 101 calls to the database.  If the network is busy, slow, or there is a lot of data to filter through, all of this can slow the report, and then it needs to format the data.  If you can cut the data to 1 call to the database...well speed will increase.  Also you can time your sql execution, maybe it is taking a long time and some optimization can be done...it may not all be Crystal's fault.
IP IP Logged
asma
Newbie
Newbie


Joined: 12 Apr 2009
Location: United Arab Emirates
Online Status: Offline
Posts: 4
Quote asma Replybullet Posted: 21 Apr 2009 at 3:59am
how can i minimize the calls, i guess whats happening is what u have said, subreport being called for every item. And inside a subreport , there is a huge query with number of records to be searched for inside it.
But how can i minimize the calls , any lead would be helpful. The subreport is a sales report, while as the main report is the inventory report. completely unrelated data, it would be a mess, if i tried to incorporate the subreport data in the main report without using a subreport.
 


Edited by asma - 21 Apr 2009 at 4:00am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Apr 2009 at 6:48am
can't be completely unrelated, or you wouldn't have a subreport.  the subreport is linked somehow, so they are related.
 
The simplest way, which may make for a long datarow is to create a super record that has the main and the subreport data contained in it.  Then the main report data is displayed as a group header and the subreport data is displayed as details. this would be done in a stored procedure, more likely than not.  Binding to the tables directly, may not allow the data to be properly created (this might be where the unrelated data would make sense, too many or too few records)
 
This gives 1 call to the database, instead of the number of the rows in the main report +1.
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