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

Splitting a Report into Two Sub Reports

Status
Not open for further replies.

jakecolman

IS-IT--Management
Apr 2, 2006
54
US
I am using Crystal Reports XI with Oracle 9.

I have an existing report that show "Asset-Level Liqudity". They want this report modified to now show "Vehicle-Level Liquidity" as well. The query for VL is fundamentally different than the query for AL so I believe I need to do this using subreports.

The requirements are as follows:

1) Common page header/footer on all pages.
2) Each page related to VL has an additional header stating "Vehicle-Level".
3) Each page related to AL has an additional header stating "Asset-Level".
4) A page break between the VL and AL sections.

I am new to subreports. Do I modify this report to use two subreports, one for VL and one for AL? If so, how do I convert the existing AL section to be in a subreport? Are subreports essentially worked with as if it was a report unto itself?

Thanks for any help!

...Jake
 
If the number and type of columns is the same, you can use a UNION query to combine the data sets via a Commans, View, or Stored Procedure.

- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Yes, subreports can behave independently of the main report (or you can use main report values through linking). In this case, it sounds like you would want to have the main report based on one query, and then add a subreport to the report footer for the other one. Within the sub, you can create a fake page header (subs don't have them), for your heading by creating a formula:

whilereadingrecords;
1

Insert a group on this, remove the groupname, and use this as your page header.

Also format the report footer to "new page before". You can conditionally suppress your main report page header by adding a conditional suppression formula in the section expert->page header->suppress->x+2:

onlastrecord

There is a more complicated way to do the page header suppression that works more consistently (even when there is an orphaned last detail record), but this might work fine for you.

-LB
 
Thanks, everyone, for your help and suggestions. What I ended up doing was creating a new report containing two detail sections, one for each subreport. In one of those sections I reimplemented the logic from the existing report and in the other section I implemented the new report. This seems to work fine. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top