Question : VFP 6 - Simple Grid on Form and run reports

I have a simple Visual FoxPro 6 form with a grid and 3 buttons (Preview, Print, Cancel).

What I want to do is select a record and if Preview or Print is selected, to run the report using only the data from the selected record.

Here are the issues
1) How to set the column widths on the grid (2 fields)
2) How to get the currently selected row from the grid (just use recno()?)
3) I need to create a report (or 2 reports) - Basically, they are to be treated as 2 separate reports but I need the 2nd report to begin at page 2, so is there a way to combine 2 reports into a "set", so that when you do a report form x preview that it will run both reports and the 2nd report begins on page 2?

Answer : VFP 6 - Simple Grid on Form and run reports

1) How to set the column widths on the grid (2 fields)
THISFORM.Grid1.Column1.Width = 20
THISFORM.Grid1.Column2.Width = 30

2) How to get the currently selected row from the grid (just use recno()?)
Yes RECNO() is OK

3) You have to remember _Pageno value in some variable (e.g. _LastPageno) after the first report and print
_pageno + _LastPageno
in the second report

Or switch to VFP 9 which allows NORESET keyword in REPORT FORM command
Random Solutions  
 
programming4us programming4us