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

Single sided printing

Status
Not open for further replies.

Steve-vfp9user

Programmer
Feb 5, 2013
334
GB
Hello

I am a little confused with single sided printing of reports.

As per the help file, when I issue:

cPrinter = GETPRINTER( )

The user selects from a list of available printers (if no selection then printing does not occur)

The options on the printer selection menu are name, status, type, where and comment.

Am I right in saying that by default a report should just print single sided and it would be the printer that prints double sided if set up in that way?

I am issuing the standard command of REPORT FORM MYFORM NOCONSOLE TO PRINTER FOR ... CONDITION ETC

Thank you
 
Yes.
If the printer is capable of two sided printing and the printer is configured for two sided printing as the default, it will print two sided. But if you toggle the single/double setting when choosing the printer in GETPRINTER(), it will print whichever way you choose but only for that print job.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
1. cPrinter = GETPRINTER() only let's you see a user choice of an available printer in the variable cPrinter. That doesn't change where the VFP report is printed at all.
2. SET PRINTER TO NAME GETPRINTER() sets a different printer an FRX may use. That can differ from the default windows printer, without setting that other printer as the windows default. But it only works for FRXes without embedded printer info.
3. Embedded printer info in an FRX (rec no1 Expre Memo) has priority over both the default windows printer AND the printer you set via SET PRINTER TO NAME GETPRINTER().
4. Conclusion: Printer settings in regard of double sided printing are only overridden by an FRX, if there is printer info embedded including the option to print double sided. In that case, that can even override that printers setting. Otherwise VFP uses the printer as it is set up.

All this I conclude your report has embedded printer info (4) and it overrides the setting of the printer itself.

Simply MODIFY REPORT and see in the report properties, tab "Page Layout": Is "Save printer enviroment" checked? Then you have embedded printer info in your FRX.

Since the days of VFP6 everybody was saying remove data from record no. 1 Expr field. At that time up to 2006 we didn't have the "Save printer enviroment" checkbox at all and it was a well known workaround to remove these infos from an FRX. ONLY use that, IF you want to print to THAT printer ONLY, and have reasons to embed certain printer options into the report.

Bye, Olaf.
 
Thank you both for your very quick responses.

I have checked the report properties to ensure that there is no printer associated with the report so it's as you say (and as I suspected) its the printer settings.

I'll ask the person concerned to check the printer menu and I will post a reply in due course.

I appreciate your posts guys.

Steve
 
You can of course easily check (or let the customer check), what the setting of the printer itself are via the windows control panel -> printers.

If you have no embedded printer info the report will print with that setting, unless the user changes it via the GETPRINTER dialog. I'm not sure if that only changes the printer settings for the next prin job, as Dave says. That dialog simply starts the system printer settings dialog, so whatever users set there will be settings of the printer from then on. That's what I would say. Nevertheless that would mean it's the users "fault" or choice, it doesn't come from your FRX.

It's simple to prove. Let the customer set the printer to single sided printing and print your report there. Then let the customer set the printer double sided and print again. If both jobs print single or double sided it's your report overriding the printer settings.

Bye, Olaf.
 
For what it's worth, this is what I do:

I advise the customer to install a second instance of the printer driver, with a different name (say, "Laser Printer Single" for the first instance, and "Laser Printer Duplex" for the second). Then, go into the printer properties for the duplex version, and fix it so that it prints double-sided (how you do that depends on the make and model of printer, but it's usually obvious.)

You do the above once only, when you are setting up the system.

Now, when it's time to print the report, the user brings up the standard Printers dialogue, and chooses either the single-sided or the duplex printer, as appropriate. If you don't want the user to see the dialogue, use SET PRINTER TO NAME in your code to choose the printer programmatically.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Indeed what Mike says is a general known to work solution to have predefined settings for printers, without fiddling with them. Nevertheless, this only works good, if users don' fiddle with these printer settings. Otherwise a printer named "Laser Printer Single" would not print single sided, if a user changes it to duplex, for example. Introducing multiple installations of the same printer with different names for different settings otherwise is a way to prevent some user setting it in one way and the second user not knowing that. If everybody is informed and conforms, this is a nice solution.

Bye, Olaf.
 
I'll ask the person concerned to check the printer

Just to add to what Mike and Olaf have already advised to you...

The Print on Both Sides setting is most often set at the workstation level as part of the print driver configuration.
And, depending on what the user did, they might have changed the setting from its original configuration to meet one report's need and did that change in such a manner so as to leave it (inadvertently?) set that way.

So, as suggested above, the best approach would be to set up an Additional, New Print driver in the workstation(s) with the Print on Both Sides not checked.

An alternative (definitely a 2nd choice) would be to put new code into your application to send the appropirate Printer Command Language (PCL) commands to the printer to ensure that it was temporarily set to Single Page Print mode and then restore it to its original setting after you print.

Good Luck,
JRB-Bldr
 
Another thing to keep in mind ....

The above suggestions are dependent on the particular make and model of printer that's installed. If you programmatically choose between the single- or double-sided printer, or if you send PCL codes, you might need to change your program code when the customer replaces their printer with a different model.

Just something to keep in mind.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
What Mike says is very true.

It would also hold true that if a different printer were installed, one or more new workstation print drivers would also need to be installed to meet the Double-sided/Single-sided printing needs. However that could be done without application code changes.

But if your application automatically printed to a specific printer without user input, you would need to change that application code as well to send to the new printer by name - assuming that the new print driver(s) were using a different name.

NOTE - I have had network administrators install new printers with new names at client sites despite my having given them directions to make the printer names department specific and thereby 're-usable' and not printer model specific. These totally new printer names introduced the need for application code and/or data table field value changes.

Good Luck,
JRB-Bldr
 
Another idea ....

Instead of relying on hard-coded printer names - or hard-coded knowledge of which printers are duplex - you can get that information programmatically, and thus select the printer without user intervention, and without having to change your code when the hardware changes.

To illustrate, the following code builds a two-column array. The first column contains the printer name and the second contains a note of whether the printer is duplex:

Code:
lnPrins = APRINTERS(laPrinters)
FOR lnI = 1 TO lnPrins
  lcName = laPrinters(lnI, 1)
  laPrinters(lnI, 2) = IIF(PRTINFO(10, lcName) = 2, "Duplex", "Not duplex")
ENDFOR

The resulting array could make a starting point for the code that selects the appropriate printer for a given job.

Mike


It would be




__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hello Mike (and others on this thread)

Having asked the users to try different printers it proved the point that the printer setup on the "offending" printer was in fact set to double sided. A quick change has now resolved the issue.

Mike, thank you for your suggestion but for now the GETPRINTER command is efficient for it's purpose.


Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top