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!

Need Subreport Collated in Main Report

Status
Not open for further replies.

weigoldk

MIS
Jan 12, 2001
249
US
I want to combine four reports into one. They all use the same parameter--a date range using a start date and and end date for my date range (I want to break this up by month). They all use the same table (sql). I can't figure out how to get the information into one report, so I made four. Now I can't figure out how to combine the four into one.

Each of these reports have all information hidden except for the page header (with just the print date), Group Footer with the Deposit amount (so I end up seeing the month total here), and page footer with just a page number.

I tried putting my 2nd report in the group header of the first report, but that didn't work like I wanted it. I end up with report 2 repeating for each listing of the main report group footer. I linked the subreport on start date and end date and it only prompts for one set of dates (so that's a good thing).

If I can get this done without using subreports, I'm game. Here's the criteria for the four reports:

Report1
ID >0
Deposit >0
Name>0
ChecknNo = 0

Report2
ID>0
Deposit<0
Name>0
CheckNo>0

Report3
ID=0
Deposit<0
Name=0
CheckNo>0

Report4
ID=0
Deposit>0
Name>0
CheckNo=0

 

Try writing a formula specifically to group your records. Eliminating the subreports will make the report run faster, since it only has to retrieve the recordset once.

Code:
// {@Grouping}

if
ID> 0
and Deposit > 0
and Name > 0
and ChecknNo = 0

then 'One'

else

if
ID> 0
and Deposit < 0
and Name > 0
and ChecknNo > 0

then 'Two'

else

if
ID= 0
and Deposit < 0
and Name = 0
and ChecknNo  0

then 'Three'

if
ID= 0
and Deposit > 0
and Name > 0
and ChecknNo = 0

then 'Four'

Then group on this formula and calculate your summaries at the group level as usual.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top