jinnytech
asked on
VFP 9.0 -How do I use 2 reports to print as a 2 page report?
Example: 1 table with 10 columns/fields and 5 records
2 report files: Page1.frx and Page2.frx
I need to print 5 fields on on Page1.frx on pg 1, the the last 5 fields on Page2.frx on pg 2. The next record would print on pg 3 and 4, etc.
2 report files: Page1.frx and Page2.frx
I need to print 5 fields on on Page1.frx on pg 1, the the last 5 fields on Page2.frx on pg 2. The next record would print on pg 3 and 4, etc.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
jrbbldr, thank you for your reply. I understand your suggestion.
But I'm actually wanting a single record of data, with 10 memo fields, to appear on 2 reports(.frx). 5 memo fields on Page1.frx and the remaining 5 memo fields on Page2.frx.
I've tried the report listener class and chaining the reports together, but the problem is, for 100 records, it prints Page1.frx with 100 pages, then prints Page2.frx report with 100 pages. I'm then left with a collation problem.
I need the first record, 5 memo fields, to print Page1.frx, then Page2.frx to print the remaining 5 memo fields for the first record on page 2. The next record would print on pg 3 and 4 and so on.
Couldn't I use the report classes and let the two reports run, then sort the output before actually sending to the printer or preview? This is the same output the report classes use to determine to total number of pages.
Thanks,
Paul
But I'm actually wanting a single record of data, with 10 memo fields, to appear on 2 reports(.frx). 5 memo fields on Page1.frx and the remaining 5 memo fields on Page2.frx.
I've tried the report listener class and chaining the reports together, but the problem is, for 100 records, it prints Page1.frx with 100 pages, then prints Page2.frx report with 100 pages. I'm then left with a collation problem.
I need the first record, 5 memo fields, to print Page1.frx, then Page2.frx to print the remaining 5 memo fields for the first record on page 2. The next record would print on pg 3 and 4 and so on.
Couldn't I use the report classes and let the two reports run, then sort the output before actually sending to the printer or preview? This is the same output the report classes use to determine to total number of pages.
Thanks,
Paul
ASKER
pcelba, let me test your suggestion, I had tried that solution before but did not use the NOPAGEEJECT
option. I'll reply after testing.
Thanks,
Paul
option. I'll reply after testing.
Thanks,
Paul
But I'm actually wanting a single record of data, with 10 memo fields, to appear on 2 reports(.frx). 5 memo fields on Page1.frx and the remaining 5 memo fields on Page2.frx.
Pavel's approach is a good one, but the approach I offered will also do much the same.
Pavel's approach uses 2 separate VFP Report Forms: Page1.frx & Page2.frx -- which after reading your statement above it might seem appropriate.
But your original post also indicated
The next record would print on pg 3 and 4, etc.which led me to believe that you wanted a contiguous single report.
My approach assumes that you want to use a single VFP Report form (MyReport.frx) , but want to see the different fields printed on separate pages
* Record 1 fields 1-5 on Page-1
* Record 1 fields 6-10 on Page-2
* Record 2 fields 1-5 on Page-3 (as suggested in your original post)
* Record 2 fields 6-10 on Page-4
* etc.
I do notice a change that would need to be made to the previous example code:
* --- Define Data For All EVEN Pages ---
SELECT fld6 [b]AS fld1[/b], fld7 [b]AS fld2[/b], fld8 [b]AS fld3[/b], fld9 [b]AS fld4[/b], fld10 [b]AS fld5[/b], SPACE(6) as Page from DataTable INTO CURSOR RptData2 READWRITE
My approach would give you a single continuous report (pg1, pg2, pg3, pg4, ....) but the text and other objects would be the same on both pages.
One way that I have done a single multi-page VFP Report Form is to:
1. Develop 2 single page report forms
2. Close the report forms and then open them with the VFP Command window (USE MyReport.frx)
3. Add in PRINT WHEN expressions for all objects
( for Page #1 --- REPL ALL SupExpr WITH "PAGENO = 1" FOR BETWEEN(OBJTYPE ,5,8) )
( for Page #2 --- REPL ALL SupExpr WITH "PAGENO = 2" FOR BETWEEN(OBJTYPE ,5,8) )
4. Close the tables
5. Open the 2 report forms
6. On the Page 2 form - SELECT ALL
7. On the Page 1 form - PASTE
8. Then on the report data table/cursor be certain to add another additional field PAGENO C(1) and populate it as needed.
9. Finally print everything to the single overall report form.
The PAGE field controls the VFP Report Form GROUP 'telling' it to go to Eject and go to another page.
The PAGENO field controls what text and other objects to print on any individual page.
It sounds like a lot of work, but it results in a single continuous (pg1, pg2, pg3, pg4, ....) report.
Good Luck
ASKER
jrbbldr,
Thank you for your detailed answer. I understand. I'm sure your method will come in handy on a future problem.
Thank you for your detailed answer. I understand. I'm sure your method will come in handy on a future problem.
Reading your question suggests that you want more than just Fields 1-5 on Page1 and Fields 6-10 on Page2.
Instead you also want only a single record on each page.
For that I would use VFP Report Groups to control the output Report pages where each Group started a New Page.
And the Report Form would not Print that new field - merely use it for Grouping.
I would first gather the data into a separate temporary table or cursor and add an addition field (maybe named: "Page")
Then I would populate those new fields with the appropriate values so as to differentiate the Groups of records desired.
Open in new window
Also note that there are numerous other ways to achieve what you need, this was merely one approach.
Hopefully that will give you what you need as long as you have set up your VFP Report Form Groups correctly where each Group was defined by the 'Page' field.
Good Luck