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!

Multiple subreports bad? 1

Status
Not open for further replies.

CrystalQB

Programmer
Jan 9, 2008
18
US
Hi all,
I am trying to determine the best way to go about this report I have been assigned.
Working with Crystal 9 -- SQL Server 200 stored procedure is my datasourse, and it's on an OLE DB connection.

The dilemma is, the origianl report has about 9 subreports, all with different tables and relationships intertwined. In all there's probably 15 tables involved.
Now, I'm one of those of the mind that if it can all be fed into a stored procedure, let's just bring back one dataset, and avoid all the different subreports. Trouble is...this is a PO form with several different addresses and line item comments, quantities and prices, etc. And since I can't suppress a line within a formula or group of fields in a section. (ie, if there is no "Contact" line in the address, I would want to see only 4 lines for the address as opposed to 5.) So subreports are a bit ineveitable, so it seems. Since you can suppress a line if it's blank that way.
My question is, how many subreports are still "healthy", and not going to drag the report down. And should I use the individual tables? Or go ahead and use my stored procedure over and over again within the subreports.
Does this make any sense, or am I just rambling?

Thanks in advance for any advice,
CrystalQB
 
There are ways to eliminate lines in addresses--just place each address element in its own section, e.g., detail_a, detail_b, etc. and then format each section to "suppress blank section".

The fewer the subreports the better, but the bottom line is it depends upon how happy you are with the speed for processing.

-LB
 
I tend to agree that separate sections for the addresses would be great...however, the layout really isn't able to be suited that way. Two of the sections need to be next to each other, and another slightly above and in the middle of both of those. Just not condusive to the sections thing, unfortunately. Beleive me I've tried, wishing it would work. :) So multiple subreports it is...BUT...

More specifically on my question about using separate datasources...
if I DO have to use several subreports...is it better to use the same stored procedure over and over? Or should I just use smaller stored procs for each of the address field sections?

I'm sure it's a preference thing...but what is the better practice?

Thanks,
CrystalQB
 
I don't really know the answer to that. I would think though that whatever would speed up the running of the individual subreports (if run on their own) would be the best solution.

-LB
 
CrystalQB,

Here is an approach using a formula for the address. Note that if any of Address 1, 2, or 3 are blank, that line will not print. Just put the formula on the report as one line deep, but set it to "Can Grow":

StringVar Address1 :="";
StringVar Address2 :="";
StringVar Address3 :="";
if Trim({table.Address1}) <> "" then Address1 := {table.Address1} + chr(13) + chr(10);
if Trim({table.Address2}) <> "" then Address2 := {table.Address2} + chr(13) + chr(10);
if Trim({table.Address3}) <> "" then Address3 := {table.Address3} + chr(13) + chr(10);
Address1 + Address2 + Address3 + trim({table.City}) + ", " + {table.State} + " " + {table.ZipCode}


Andy
 
Thank you so much Andy...this may just be the solution to my problem.

Cheers!!
Crystal QB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top