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

Print formats .frx/.frt - Printer environment 1

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
I have an application which has many reports. Each report uses a pair of .frx/.frt files which defines the layout of the report. These report layouts are not bound into the executable program (.exe), because some users may want to modify a report or provide their own layout. So the report layouts (as issued) are in sub-folder reports, and the user’s modified reports (if any) are in folder replocal (which is specified earlier in the path).

Sometimes I have re-issued the system (including the reports folder), and (by mistake) I have left the ‘Printer environment’ option ticked on one of the layouts.

The application gives each user the option – at the time of running a report – of sending it to printer, to screen, to Excel, or to a pdf printer; I use Bullzip, but realise that there are several other drivers available.

If (by chance, my error), I have issued a .frx/.frt report definition with the ‘Data environment checked, and the user has asked for the report to go to pdf, then my SET PRINTER TO <pdfprinter> is ineffective at run-time.

Is there a way that I can over-write the checked ‘Printer environment’ option. Or could a kindly Tek-Tips subscriber provide a utility which could tidy up these ‘Data environment’ settings in a .frt file, and I can then issue this utility as part of the application.

Thank you - Andrew
 
Hi,

It's very simply:
[pre]USE report.frx
GO TOP
REPLACE TAG WITH "", TAG2 WITH ""
USE
[/pre]


MartinaJ
 
Just once more the same warning I already told you in thread184-1814344

The memo fields that save the printer environment do not only save the printer name the report uses, they store many settings like ORIENTATION=LANDSCAPE vs PORTRAIT, which are independent of the printer.
Rigorously removing the memo contents is a commonly used solution, it seem you didn't pick up we already suggested exactly that. But also, that you don't just clear out the printer used, if your report would be designed for landscape paper orientation you won't get that if you simply delete the whole memo content.

Chriss
 
Besides, Mike's article on Controlling report settings at run time showcases what a typical memo content is, the settings are stored in simple text format, not binary, you can use ALINES(), for example, to extract the lines into an array and then iterate them and keep all lines not starting with DEVICE=, only that DEVICE line determines the printer used and overrides both the default system printer and the printer you set by SET PRINTER TO NAME xyz. You could also just remove that line and keep all other settings untouched.

You don't have to be as rigorous as deleting all content from the Tag fields.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top