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

More hacking frx

Status
Not open for further replies.

AlanArons

Programmer
Aug 1, 2002
91
US
The recent discussions about hacking an .frx are great as this is my task at hand for the next few days.

My problem #1 is how to determine and set the printer information to be included in the header record. I would like for the users default printer info to be included.

Question #1 is how do I determine the users default printer.
Question #2 is how to create the binary info included in TAG and TAG2 fields (Is this really necessary since I will be using the TO PRINTER dialog)

I hope everyone had a great holiday.

Thanks for your help

Alan Arons [ponder]


 
Alan,

Question #1 is how do I determine the users default printer.

That's easy:

? SET("PRINTER", 2)

My problem #1 is how to determine and set the printer information to be included in the header record.

Are you sure you need to do that? If you know which printer you want to send the report to, just issue SET PRINTER TO NAME .... before you do the report.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Mike
Thanks for your help.

I still wonder, however, if the data in the TAG and TAG2 fields are significant. If it is, how do I generate the binary information.

Thanks again

Alan Arons [ponder]
 
In fact the default printer is called the default printer, because it's the default printer used if you don't specify or choose a special printer. And therefore you should simply keep out any secific printer info from FRXes. And if you want a special printer choose it by SET PRINTER. There's a bit more to it, if it comes to setting duplex print, number of copies etc. But that is so printer specific that there is no general way to do it. Only if you have that exact same printer at hand during the report development, you can embed the printer information by the "save printer environment" within the report properties.

Otherwise I'd avoid that even for the simpler options like number of copies, simply print the same report N times, the copies = X line won't always work, the VFP FRX mechanism is not a windows standard every printer will support. the same goues for page orientation etc.

For Windows versions before Vista you can give the user sys(1037) to choose (extended) printer settings, for Vista that dialog has changed and you'll need to use windows API for such things. If you want total control over each and every printer and it's options you're out of luck anyway.

To gain more control use report writer in conjunction with gdiplus to make the layout exactly as you want it or print pdfs with a pdf printer driver giving you all the options you want and then let users print out that.

Bye, Olaf.
 
Alan,

how do I generate the binary information.

You don't. If you really want to hack the FRX, just edit the Expr field. VFP will automatically "compile" that field to binary. You never need to edit TAG or TAG2.

But I still feel sure you don't need to do any hacking in this case.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top