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

Collating separate reports

Status
Not open for further replies.

slmorgan

MIS
Nov 19, 2008
2
GB
Hi does any know how you can collate two separate reports with a one to many relationship. The first report can span mulitple pages per record and the second report can have 1 or more pages.

I do not need page numbers.

Any help greatly appreciated.
 
Please explain what you mean by "collate two separate reports".

On a copier with the collate feature you typically end up with all of Report1 in one group of pages and all of Report2 in another group of pages. Much as you would if you printed Report1 and then followed by Report2 on a printer.

If that is what you want, then merely allow the user to input the number of copies desired prior to going to your REPORT FORM command(s) and then Loop through the number of copies desired.

You would print a single copy the first report in its entirety followed by the next report and then loop back to begin again - resulting in multiple collated copies.

If, however you did not want 'collated' reports, but instead multiple copies of each separate page, then the best way might be to control the Print Copies parameter of the printer.

Good Luck,
JRB-Bldr
 
hi JRB-BLDR

Thank you for your response. The scenario is: The user can select one or many records to print from one report, and then has to select the corresponding images from another report. The two tables can be joined by reference number and has a one to many relationship. They then have to manually insert the corresponding pictures from reprot two after the information from report one. Is there a way that I can print a record from report one then look at table two for related images and print those from report two and then go back to report one etc.
 
"Is there a way that I can print a record from report one then look at table two for related images and print those from report two"

It sounds as though you are not asking for collating at all, but instead you seem to want to sequentially print 2 reports allowing for review and/or manual selection time between the printing of the 2 reports.

That doesn't take anything special.
Just write the code as needed.

One thing that has worked for me when there is a one-to-many Parent/Child relation is to use a 'backwards' relation for printing. That way ALL Child records are available for any Parent record during the printing.

The other way would be to use a SQL Query to collect all desired data from both tables into one single Table/Cursor to use for printing. That way you could limit the resultant ReportData to only those records from the Parent and/or Child if desired (such as only 1 Parent record).

The 2 'backwards' related table method might look something like:

Code:
* --- Set 'backward' Relation ---
SELECT RptData1  && Parent table
SET ORDER TO <DesiredIndex>

SELECT RptData2  && Child table
SET RELATION TO <Expression> INTO RptData1

* --- Print Report #1 ---
SELECT RptData2
SET FILTER TO RptData1.Fieldn = <Desired Value>  && Print all data for only 1 Parent record 
REPORT FORM MyReport1 NOCONSOLE TO PRINT  

<do whatever>

* --- Print Report #2 ---
SELECT RptData2
SET FILTER TO RptData1.Fieldn = <Desired Value>  && Print all data for only 1 Parent record 
REPORT FORM MyReport2 NOCONSOLE TO PRINT

The alternative SQL Query method suggested above will also work nicely. You can work that one out for yourself depending on the fields from each table required and specific the selection criteria desired.

If you need something else, I am not understanding your needs clearly enough.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top