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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Processing Speed

Status
Not open for further replies.

racskelly

IS-IT--Management
Apr 19, 2007
37
CA
Some of my reports seem to take forever to run...and i don't feel like there is enough data there to cause this slow down.

For this example I have the following table structure

Table A - trade_num
1. trade_num

Table B - trade_specs
1. spec_id
2. trade_num
3. spec_description

i want to combine all the spec_descriptions for trade 12345 into a single string so i created a subreport and in the footer joined all the values into a single stringvar

there are 6900 or so trades...but it is taking 45 minutes to run this report...

any ideas?
 
I don't think you need a sub or even Table A. You could just use Table B and a record selection formula of:

{tableB.trade_num} = 12345

Then create a formula for the detail section like this:

whileprintingrecords;
stringvar x := x + totext({tableB.spec_id},0,"")+", "; remove totext(,0,"") if already a string

Then in the report footer use a formula like:

whileprintingrecords;
stringvar x;
if len(x) > 2 then
left(x,len(x)-2);

If you mean you want to do this for EACH value of the tradenum, then use an equal join between {tableA.trade_num} and {tableB.trade_num}, remove the earlier suggested selection formula, and then insert a group on {tableA.trade_num}. Add the first formula above to the detail section, the second formula to the group footer, and the following formula to the group header:

whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

-LB
 
Subreports are slow because each occurence does a separate access to the database, the same thing the main report does at the start.

As lbass says, you don't seem to need to use one.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top