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

Showing individual pages when previewed but only prints one page in print mode 2

Status
Not open for further replies.

Steve-vfp9user

Programmer
Feb 5, 2013
337
GB
Hello

I am using VFP9 SP2.

There is a single field within my table called YESORNO

I am using the following code in an attempt to only print single page reports when the condition is satisfied which works when I preview the report but only prints the first record if I change the command to print:

Code:
SCAN
   mthisrec=0
   mthisrec=RECNO()

   IF YESORNO="N"
      REPORT FORM singlepagereport NOCONSOLE PREVIEW FOR RECNO()=mthisrec  &&  THIS WORKS AND SHOW A PAGE PER RECORD

*      REPORT FORM singlepagereport NOCONSOLE TO PRINTER FOR RECNO()=mthisrec  &&  THIS DOESN'T WORK AND ONLY PRINTS THE RECORD
   ENDIF

ENDSCAN

There are three records satisfying the condition in the table.

I've checked out the help file and used WHILE, NEXT etc but everything works in PREVIEW mode but not in print.

What am I doing wrong guys?

Thank you

Steve
 
Hi Olaf:


I think my explanation was not clear. I am saying very much the same thing. I meant 'dataset scope' as you expressed 'record scopes'.

'FOR' condition is equal to a "SCAN FOR'. I agree now.

The new key word 'RECORD mthisrec' works the way it should.

thanks

nasib
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top