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!

Print Two Different Reports in a single page

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
AE
Hi,

Is it possible to print as mentioned in subject?

Report Form Locfile('\reports\JobCostPrn.frx') TO PRINTER PROMPT
Report Form Locfile('\reports\SlitJobPrn.frx') TO PRINTER PROMPT

Thanks

Saif
 
NOPAGEEJECT at the end of the first REPORT FORM. But this will still cause an eject, if the reports starts with anything causing a new page, eg a page header of SlitJobPrn will print on a new page anyway, also group headers can be set to print on a new page. NOPAGEJECT is respected, but if the first element printed by the second report demands an eject, that also is respected and you get a nopageeject followed by an eject.

Bye, Olaf.
 
Following Olaf's advice, you would also have to take out the PROMPT clause on the second line. Better to use GETPRINTER() to find the user's choice of printer, and the SET PRINTER to that.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I'd also drop the use of Locfile(). Just drop it from your vocabulary. It has a side effect you may not be aware of:

Code:
?Set("path")
Use LocFile("*.dbf")
?Set("path")

It adds the path of the selected file to Foxpro's search path. In most application environments the search path is something you want to set the way you want and not have it altered.
 
Another problem with LOCFILE(): If it can't find the file on its own, it displays a File Open dialogue. That's not something you would want your users to see. There would be nothing to stop the user choosing an incorrect or inappropriate file from the dialogue, or generating a "File does not exist" error.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top