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

Report Form printer setting binding 1

Status
Not open for further replies.

Steve Yu

Programmer
Nov 6, 2021
88
US
Hello,

Wanted to force printouts to drawer #4 of the network printer (Canon) but all went to default bin regardless.
In Windows server printer setting, the custom profile, TRAY4, pops up as default profile but the actual printer setting viewed in paused print queue still shows the default profile.

Windows setting:

tray4_ugxdkn.png



Report Designer Binding (bound to TRAY4)

tray4-2_aehge1.png
:


report-form_idxlsd.png



Question:
How do I enforce the binding of my custom profile setting ?

Steve Yu
 
It's recommended to actually never use the "Save printer environment" (so uncheck that) and have reports that can be printed to either the Windows default printer or a printer you specify by the name it has in Windows Settings -> Devices -> Printers&Scanners. In your case the name you set seems to be "CanonT4 on CMDC1.crownmark.com", which you could have also set to "CanonT4" only, but that's a matter of taste.

Whatever the printer name is, you can then set that printer for VFP and run the report:

Code:
SET PRINTER TO NAME ("CanonT4 on CMDC1.crownmark.com")
REPORT FORM ...


Chriss
 
Thanks, Chris.
Will printout go to the desired paper source, tray 4, if we issue the set printer command this way ?
We are getting the right printer with saved properties, it's just printouts always go to the default paper source, not the tray with recycled paper that we wanted.

Steve Yu
 
If you setup a printer in windows, including any extended properties, like the paper tray to use, then this will be picked up.

The only issue is, that printer setup is a local thing, the setup for the name has to be the same for every client PC to work the same way. But I don't even see whether you can embed the tray number in a report with saved printer environment, the usual options VFP saves are papersize, paper orientation (portrait/landscape), copies,... things like that.

You can see what printer options are embedded into your report, if you use the FRX as a table (USE yourreport.frx) and look into the Expr memo field of the first record and see for yourself whether tray is one of the options, or another option that could mean the tray number. If not, you definiately don't gain anything from embedding printer information into the report. Don't assume any option can be embedded by VFP, it's merely a memo field that has some key=value lines, not every printer option is encoded like that. Some are very driver specific and not general purpose.

When you use the printer name option with SET PRINTER TO NAME ("WindowPrinterNameHere") all options are as defined in the Windows Printer settings. That alone means having a specifc Windows printer name/profile is superior to embedding printer info into a report.

Just notice as I described the issue, the setting are not stored into the printer, the settings are stored into the Windows Devices/Printers settings and taken from there when printing by the name dedicated to the profile. This mechanism allows you to set up the same printer even multiple times with different settings under different names.

Besides, that, if you offer the user the printer dialog and he can change settings, that'll override both the embedded settings and the Windows printer settings, so you only have final control, if you disallow users to fiddle with the printer profiles you want to be specific, like printing from a cetrtain tray, only. Besides not offering the Priunter menu you should also not use PROMPT (for promting which printer to use) in the REPORT FORM command. Only all that considered, you can enforce certain settings by predefined names=profiles. With the administration task to set up the printer on all clients in the same manner. I don't know of central printer profiles.

Chriss
 
Chris,

Will browse FRX table.
Thank you.

Steve Yu
 
Steve Yu said:
Will browse FRX table.

I thought you already tried saving printer environment with different results, so I wouldn't expect the tray setting to be embedded, though I have faint memories of that being an option, maybe not for every printer make/model. Good luck.

Chriss
 
We did save but when we checked printer preference with the print job in queue (paused) it reverted back to printer default, without our tray selection.

Steve Yu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top