Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport issues

Status
Not open for further replies.

gooseman

Technical User
Jul 1, 2002
7
US
I have two issues with a subreport.

1. The report takes a long time to run - The main report normal ran in a few minutes, the subreport runs in a few seconds when they are done seperatly. When they are together the report takes over an hour. The subreport has 13000 lines and only includes 2 fields. The report seems to go thru all 13000 lines of the subreport for every line of the main report.Is something wrong? I had all the information in a group footer on both reports and I moved them to the detail section but the results didn't change.

2. When the report is done, I need to export it to a csv file but I don't get the subreport information in the exported file. Do I have to create some kind of formula to put it into the main report? If so how to I do it.
 
You may have the subreport in the wrong location of the Main report, explain the scenario.

Linking subreports WILL slow things down significantly, if they're not linked, the overhead is minimal.

-k kai@informeddatadecisions.com
 
two things...

1. You say that each record of the subreport generates a 13000 line subreport .... do you want this or only relevant info from the subreport?? You may have a linking problem with your subreport.

2. Trying to export a subreport is tough I think...perhaps it would be better (especially if there is only 2 fields of Subreport info/line of main report) to use shared variables to transfer the data from the subreport to the main report. Then I think it would export properly (I could be wrong though on this) Jim Broadbent
 
The main report has all the fields in the group footer. I inserted the sub report into the footer. I had to create a formula for the fields that I'm linking on because they were formatted differently. The field consist of a purchase order number that I used a the trim formula on. The main report and subreport on linked on the formula field for purchase order number. The sub report only has purchase order number and activity number in a group footer. I also tried putting both the main report and sub report in the detail section but I got the same slow result.
 
The delay is probably based on Crystal doing all of the work, providing you're getting the right results.

I would try to do some data correction on the database side either by using a proper table structure, or by creating a SQL Expression upon which to link.

-k kai@informeddatadecisions.com
 
Show us some details....we cannot comment on anything other than generalities

there may be something wrong (or inefficient) with your linking formula(s) AND/OR the Record Selection formulas of both the Main Report and subreport.

The fact that you are getting the reults means that there is nothing inherently wrong with your reporting from 2 different databases.

Rather... you are not doing it in an efficient manner.

Present us specifics...in the form of how you have the main report set up (define the groups, show where key formulas are located as well as where the subreport is, are you displaying the supreport or using shared vales or both)

Show us the record selection formulas for both the subreport and main report and show us the linking formulas

only then will we be able to solve your problem
Jim Broadbent
 
The subreport will run as many times as the section it is placed in appears. My guess is the selection formula of the subreport (which is probably using functions) is not being passed to the SQL which slows it down. What is the selection formula of the subreport. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top