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!

Checking for ‘Save Printer environment'

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
1
18
GB
I have several reports where I offer the chance of printing to paper, to screen, or to a pdf printer.
To organise the pdf printing, I include code more or less like this :

Code:
lfrxname = “<The frx file name for the report>”
lName = “<My PDF printer name>”
SET PRINTER TO NAME (lname)
REPORT FORM &lfrxname NOCONSOLE TO PRINTER

This usually works fine, but I sometimes make the mistake during report design of leaving the ‘Save Printer Environment’ checkbox ticked; and this means that at run-time the report does not go to the PDF printer.

I would like to include a check at run-time to warn the user that this is the case (and possibly include code to make the necessary change to the .frx/frt files).

What is the easiest way of doing this? Thanks - Andrew
 
It seems that if Printer environment is unchecked, than the tag and tag2 fields in the type 1 record are blank, whereas if Printer environment is checked, these fields have a value.

Would this be a way of testing whether ‘Printer environment’ is checked? and indeed a way of clearing that setting – by USING the .frx file as if it were a .dbf file, and clearing those two memo fields?
 
Andrew Mozley,

haven't you already been discussing all the details about this in your recent thread thread184-1813451 and in the follow up thread of Mike Lewis, thread184-1813473?

The printer settings always were stored in Tag, Tag2 of the first record of an FRX.
Even before VFP had the option to save or not save the printer environment, the hack to clear these fields were the commonly known method to get rid if it, see
The Expr field can also contain a line DEVICE=... that points out the printer to use. But this field also contains info like ORIENTATION for portrait or landscape reports, so you may not want to clear it fully.

The uncertainties of Mike Lewis are less important, I think they are just about the details in the Expr field, the meaning of the tag and tag2 fields in this essential report records are well known already since reports exist, you simply clear them to get rid of things that hinder the report to run for anyone not having your printer.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top