Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Report hangs up Post Reply Post New Topic
Author Message
richlaz
Newbie
Newbie


Joined: 22 Mar 2013
Online Status: Offline
Posts: 3
Quote richlaz Replybullet Topic: Report hangs up
     Posted: 22 Mar 2013 at 10:50am
I have a problem with a sales report I created.  It asks for a start date and end date for the records to be included.  If I choose 1/1/2013 to 1/31/2013, the report takes about 30 seconds to run.  If I choose 1/1/2013 to 2/28/2013 the report takes about 40 seconds to run.  But if I choose 2/1/2013 to 2/28/2013 it never finishes.  The closer my start date gets to 2/1, the longer the report takes to run! So if start date is 1/27, report takes 1 1/2 minutes, 1/29 - 3 minutes  1/31 - no finish.  Anyone ever run across this kind of problem?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 26 Mar 2013 at 6:15am
Odds are this is a database issue.  What type of database are you connecting to?  What type of connection are you using?  Do the tables you're accessing have indexes?  How big are the tables?
 
-Dell
IP IP Logged
richlaz
Newbie
Newbie


Joined: 22 Mar 2013
Online Status: Offline
Posts: 3
Quote richlaz Replybullet Posted: 26 Mar 2013 at 6:43am
Database is MS SQL 2008.  Going over RDC.  The tables are not that large. The main table is only 11000 rows, but the selection formula brings it down to less than 500 rows per month. The linked table is not indexed & has over 900,000 rows.   But what has me puzzled is that if I run the report from 1/1/13 to 2/28/13 it takes only a minute to run.  But if I run it from 2/1/13 to 2/28/13 (a shorter period with less records), it never finishes.  And it seems that the closer my start date gets to 2/1, the longer it runs, which I find counter-intuitive.  And if the problem were in a record from the 2/1 to 2/28 period, why will the 1/1 to 2/28 report run fine, and in a short time?
  
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 26 Mar 2013 at 7:24am
Which version of Crystal?
 
I would try getting the SQL that Crystal has generated and running it in SQL Server Management Studio or Toad, etc.  Run it for the January date range and then for the February date range.  If there is a significant difference in the run times, this will indicate that the issue is in the database.  If not, then there is an issue with the report.  If the issue is with the report, please post the formula from the Select Expert - I'd like to see if there's anything there that would cause the data filters to process in memory instead of in the database.
 
-Dell
IP IP Logged
richlaz
Newbie
Newbie


Joined: 22 Mar 2013
Online Status: Offline
Posts: 3
Quote richlaz Replybullet Posted: 27 Mar 2013 at 6:13am
I ran it in SMS yesterday.  I found what's causing the problem, and was able to fix it.  I'm not sure why it worked previously & didn't on the later dates!  I was linking my order header table, which had order #, sales rep, date to a detail table that had all the lines for the order with a inner join.  I was also linking my user name table to the order header table by sales rep  with a left outer join.  I changed the link  from the order header table to the order detail table to pull the user name and now it works fine.
Thanks for the help Smile
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