Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Margins getting chopped
Message
From
17/06/2015 16:08:54
 
 
To
17/06/2015 14:45:59
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01621019
Message ID:
01621102
Views:
85
>>>>aL,
>>>>
>>>>This is a new report. All settings are as you have them. So I still don't know why it is putting the default printer (CutePDF) in the report. Then when I select the laser printer, it chops off the margins.
>>>
>>>Hmm, what happens if you temporarily change your Windows default printer to something else? Does that new default printer now show up, or is it still CutePDF?
>>
>>This is what I did:
>>
>>
>>Windows default printer = HP LaserJet M1530 MFP Series PCL 6
>>VFP default printer = HP LaserJet M1530 MFP Series PCL 6
>>Text in the 'printer' textbox of the 'page layout' tab of report properties = HP LaserJet M1530 MFP Series PCL 6 (Default)
>>
>>
>>I then changed the Windows default printer to CutePDF Writer. However, the VFP default printer did not change.
>>
>>
>>Windows default printer = CutePDF Writer
>>VFP default printer = HP LaserJet M1530 MFP Series PCL 6
>>Text in the 'printer' textbox of the 'page layout' tab of report properties = HP LaserJet M1530 MFP Series PCL 6 (Default)
>>
>>
>>I then changed the VFP default printer to CutePDF Writer.
>>
>>
>>Windows default printer = CutePDF Writer
>>VFP default printer = CutePDF Writer
>>Text in the 'printer' textbox of the 'page layout' tab of report properties = CutePDF Writer (Default)
>>
>>
>>The problem seems to be that when the default printer is CutePDF Writer, when I issue the following:
>>
>>
>>lcFile = 'INTFBTCH'
>>DO (_REPORTOUTPUT) WITH 1, 'loListener'
>>
>>loListener.PRINTJOBNAME = "C:\pj\INTF\Batch Packages\" + lcFile
>>REPORT FORM intfbtch TO PRINTER PROMPT PREVIEW OBJECT loListener
>>
>>
>>VFP presents a dialog that has CUTEPDF selected and even when I change that to HP Laserjet, it still seems to be using the underlying printer driver of the default printer, CutePDF!
>>
>>Bottom line: When the default VFP printer is CutePDF, the output is not right even if I select the Laserjet for print.
>>
>>How can I solve this???
>
>Does the report print properly as long as the default VFP printer is not CutePDF?
>
>As a workaround, maybe you could set the default VFP printer to something else, then set it back when you're finished e.g.
>
>m.lcOldDefaultPrinter = SET( "PRINTER", 3 )
>SET PRINTER TO [something other than CutePDF]
>...
>* Do your reporting
>...
>SET PRINTER TO ( m.lcOldDefaultPrinter )
>
>I haven't used REPORTBEHAVIOR 90 enough to be able to help troubleshooting if it's something related to that. But some other general things to check:
>
>- Are you running the FRX you think you're running? e.g. maybe you're running one embedded in an EXE when you think you've specified one on disk, or you have a PATH set and you're not running the one you want?
>
>- In the design of the report, in its Properties...Page Layout tab, is the Print Area set to "Printable page" (the default) or to "Whole page"? If the report was originally designed for CutePDF, someone may have set it to the latter (since a PDF printer driver can print to the whole page) - which might cause problems when printing to a physical printer

Al,

I used your workaround:
lcOldPrinter = SET( "PRINTER", 3 )
SET PRINTER TO NAME 'HP Laserjet M1530 Mfp series pcl 6'
lcFile = 'INTFBTCH'
DO (_REPORTOUTPUT) WITH 1, 'loListener'

loListener.PRINTJOBNAME = "C:\pj\INTF\Batch Packages\" + lcFile
REPORT FORM intfbtch TO PRINTER PROMPT PREVIEW OBJECT loListener
*!*	REPORT FORM intfbtch TO PRINTER OBJECT loListener

RELEASE loListener
loListener = NULL

SET PRINTER TO NAME '&lcOldPrinter'
This worked, except the laserjet always appears selected in the selection list. Thanks.

I'm running the FRX I think I'm running and the option is set to 'printable page'

Also, I've confirmed that this is onl;y happening when I use the report listener code. Otherwise it is fine.
*!*	lcOldPrinter = SET( "PRINTER", 3 )
*!*	SET PRINTER TO NAME 'HP Laserjet M1530 Mfp series pcl 6'
*!*	lcFile = 'INTFBTCH'
*!*	DO (_REPORTOUTPUT) WITH 1, 'loListener'

*!*	loListener.PRINTJOBNAME = "C:\pj\INTF\Batch Packages\" + lcFile
*!*	REPORT FORM intfbtch TO PRINTER PROMPT PREVIEW OBJECT loListener
*!*	*!*	REPORT FORM intfbtch TO PRINTER OBJECT loListener

*!*	RELEASE loListener
*!*	loListener = NULL

*!*	SET PRINTER TO NAME '&lcOldPrinter'

REPORT FORM intfbtch TO PRINTER PROMPT PREVIEW
Thanks!
Previous
Reply
Map
View

Click here to load this message in the networking platform