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

Setting up programmatically group in new page in VFP 6 1

Status
Not open for further replies.

CMir

Programmer
Mar 6, 2003
26
0
0
US
I have report in VFP 6 that needs to be configured in order to separate groups in new pages or printing them without having a new page for a new group. At this moment I have 2 different reports that are called accordingly but I'm wondering if there is any way of doing it through a SET command,a system variable or in an undocumented way.

Thanks.
 
I must confess that I am not 100% clear on what you are trying to do, but here is a suggestion. If it helps, great. If not, it is worth every penny you paid for it.

Your report is using a data table (or cursor).
Add field(s) to the table such that you can Sort the data as needed and / or differentiate the data records. Examples of fields to consider adding might include:
SortOrder
PageNo
etc.

Then create a Report Form for Page #1. Within ALL of the objects of the Page #1 go into the Print When... property and set it to some unique value (such as Table.PageNo = 1)

Now create a new Report Form for Page #2. Within ALL of the objects of the Page #2 go into the Print When... property and set it to a different unique value (such as Table.PageNo = 2)

Side Note: Inserting the common Print When... expression into ALL Report Form object might be more easily accomplished by accessing the Report Form's Table (FRX file) directly and doing a
REPLACE ALL SupExpr WITH <whatever> FOR INLIST(ObjType,8,5)

Repeat as necessary for all desired pages...

Now go into the Page #2
Modify Report Page2
SELECT ALL of the objects (Ctrl+A) and COPY them into your Clipboard (Ctrl+C)

Without closing Report Form Page2
Modify Report Page1
Paste ALL objects to over-lay the Page1 objects.

Now, assuming that you have populated your table's new fields appropriately and that you have set up the proper SortOrder, when you execute the Report Form the separate pages should print properly.

NOTE: Groups from Page2 will not transfer into the over-lay objects. But maybe you will no longer need them.

Good Luck,
JRB-Bldr
 
Thanks for your reply.

I think I didn't explain as I should.

Imagine, e.g., a listing of customers' bills. Having a definition in the app engine, I'd like to give the user the chance of saying "ok, I want each customer to appear in each page" putting each one on a new page OR "no, I want the customers to appear in sequence" without putting each one on a new page.
I have a report with all customer in sequence without activating any of the options when you go to Data Grouping dialog box. At this point I think I could do it, adding a new Frx file and activating the 2nd option of this dialog box.
 
"I'd like to give the user the chance of saying "ok, I want each customer to appear in each page" putting each one on a new page OR "no, I want the customers to appear in sequence" without putting each one on a new page"

That is not too hard.

As suggested above, add a new field (maybe PageNo) to the data table and set up your report group to also work on that field. And for that new group set it as "Start Each Group On New Page"

Then when your user enters "No" to displaying the customers on separate pages, merely populate all PageNo fields with the same value.

Or if the user enters "Yes" to displaying the customers on separate pages, populate PageNo with the CustomerID which will effectively cause the report to separate the pages as the group changes.

Good Luck,
JRB-Bldr
 
Thank you, jrbbldr.

It worked perfectly !

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top