PDA

View Full Version : SelectAndSetPrinter Page scaling problem



RobertRoth
14-Nov-2005, 06:07 PM
VDF11.0.77.0, Crystal Reports 10
HP 1160 (mono) and HP 2600n (color) laser printers

When either of these printers is set to the system default printer, the following code (with no
printer selection) results in a normal printed report

Procedure OninitializeReport
.......
Integer iDestination
Get PrintDestination to iDestination
If (iDestination=0) Set Output_Destination to CRW_PRINT_TO_WINDOW
If (iDestination=1) Begin
Set Output_Destination to CRW_PRINT_TO_PRINTER
End
End_Procedure

However, if SelectAndSetPrinter is used, the report printed to the 1160 is always printed correctly
and that printed to the 2600n appears to print a very small thumbnail of each page on the upper left
corner of the paper. This occurs independently of which printer is set as default. I have placed
SelectandSetPrinter in OnInitializeReport and OnStartPrinting with the same results, e.g:

Procedure OninitializeReport
.......
Integer iDestination
Get PrintDestination to iDestination
If (iDestination=0) Set Output_Destination to CRW_PRINT_TO_WINDOW
If (iDestination=1) Begin
//Set Output_Destination to CRW_PRINT_TO_PRINTER
send SelectAndSetPrinter
End
End_Procedure

Any ideas on how to overcome this would be much appreciated.

Bob Roth
Barton Nelson Inc.
KCMO

Garret Mott
17-Nov-2005, 08:51 PM
Robert -

I've been watching this thread, hoping that someone would say "Oh yeah
that's such & such" - probably just as you have! <g>.

I ran into this about 7 or 8 years ago - but using VB & Crystal - not VDF.
It was with HP printers, but I don't remember exactly which models. I've
been racking my brain trying to remember what was happening. As I remember
(& please understand that my memory isn't the best!), the fontsize on the
offending printer was getting reset to 1.

I believe I tracked it down to a difference in PCL versions on the printers,
but only "fixed" the problem either by setting it to the default & then back
gain after printing - or (& this is a maybe) setting the printer twice. My
case was one where I was setting the printer programmatically - not allowing
the user to change it.

Have you checked the CR knowledgebase? You might also try the HP one.

Wish I could've helped more - but maybe this'll point you somewhere useful,

Garret



"Robert Roth" <robert@bebco.com> wrote in message
news:k36in1tok8flrt4fq46b9ogtvmpjbpsf20@4ax.com...
> VDF11.0.77.0, Crystal Reports 10
> HP 1160 (mono) and HP 2600n (color) laser printers
>
> When either of these printers is set to the system default printer, the
> following code (with no
> printer selection) results in a normal printed report
>
> Procedure OninitializeReport
> .......
> Integer iDestination
> Get PrintDestination to iDestination
> If (iDestination=0) Set Output_Destination to CRW_PRINT_TO_WINDOW
> If (iDestination=1) Begin
> Set Output_Destination to CRW_PRINT_TO_PRINTER
> End
> End_Procedure
>
> However, if SelectAndSetPrinter is used, the report printed to the 1160 is
> always printed correctly
> and that printed to the 2600n appears to print a very small thumbnail of
> each page on the upper left
> corner of the paper. This occurs independently of which printer is set as
> default. I have placed
> SelectandSetPrinter in OnInitializeReport and OnStartPrinting with the
> same results, e.g:
>
> Procedure OninitializeReport
> .......
> Integer iDestination
> Get PrintDestination to iDestination
> If (iDestination=0) Set Output_Destination to CRW_PRINT_TO_WINDOW
> If (iDestination=1) Begin
> //Set Output_Destination to CRW_PRINT_TO_PRINTER
> send SelectAndSetPrinter
> End
> End_Procedure
>
> Any ideas on how to overcome this would be much appreciated.
>
> Bob Roth
> Barton Nelson Inc.
> KCMO