dbTalk Databases Forums  

PrinterOptionInfo and ReportPrintInfo variables

comp.databases.paradox comp.databases.paradox


Discuss PrinterOptionInfo and ReportPrintInfo variables in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Anne Wainwright
 
Posts: n/a

Default PrinterOptionInfo and ReportPrintInfo variables - 01-22-2009 , 11:14 AM






Hi all, (and best for 2009)

I had to cure a problem of printing a report, the windows default
printer driver would pop up each time and (on Pdox alone,and only late
this past year) it decided to start with a postcard sized default paper
size. No way to keep the default at A4 and clip-to-width set.

Looking at the pdox examples I saw the PrinterOptionInfo type variable
which allowed to set certain requirements, and the ReportPrintInfo type
which allowed to set others, with some overlap. Neither would set all that
I wanted. Yet the examples shown for each both concluded with
print(varname). Thus I saw an either-or situation.

I did quite easily get it to work, and my basic code structure is here

var
prnOptions PrinterOptionInfo
repInfo ReportPrintInf0
; other var items
endVar

; set printer options showing overlap item and wanted item
prnOptions.Orientation = prnPortrait
prnOptions.PaperSize = prnA4

; set report printing options showing overlap item and wanted item
repInfo.orient = PrintPortrait
repInfo.panelOptions = PrintClipToWidth

; lots of other code follows to generate report thisbuy.rsl

if printerSetOptions(prnOptions) then
thisbuy.print(repInfo)
else
errorShow ("Could not set printer options.")
endIf

; more code

thus I left the printerSetOptions as just set and 'printed' the repInfo
ones. I didn't try it the other way around, but this seemed the 'right'
thing to try.

Well it works fine, but any comments welcome on this small matter. Is
this the best approach, are the two variable each typically used under specific
circumstances?

regards
Anne



Reply With Quote
  #2  
Old   
Jim Giner
 
Posts: n/a

Default Re: PrinterOptionInfo and ReportPrintInfo variables - 01-22-2009 , 02:17 PM






I seem to remember having troulbe getting the correct response from teh call
to printersetoptions - it didn't return false when the options were'nt set.
But that was version 5 and maybe it works better in later versions.
"Tony McGuire" <png.paradoxcommunity@com> wrote

Quote:
Anne Wainwright wrote:

if printerSetOptions(prnOptions) then
thisbuy.print(repInfo)
else
errorShow ("Could not set printer options.")
endIf


That is pretty much what I have, but I believe I only need to do both in
one place. Been a while since I revisited this, though, so not certain.

Long and short, it FEELS familiar and right.


---------------
Tony McGuire



Reply With Quote
  #3  
Old   
Tony McGuire
 
Posts: n/a

Default Re: PrinterOptionInfo and ReportPrintInfo variables - 01-22-2009 , 02:26 PM



Jim Giner wrote:
Quote:
But that was version 5 and maybe it works better in later versions.
Can't help you there. My memory doesn't go back that far.


--
---------------
Tony McGuire


Reply With Quote
  #4  
Old   
Tom Krieg
 
Posts: n/a

Default Re: PrinterOptionInfo and ReportPrintInfo variables - 01-22-2009 , 06:14 PM



Anne,

What version of Paradox are you using? If 10 or greater, ISTR I had some
problems doing this with 10 quite a while back, and with Bertil's help
worked out to set the paper size (A4) using the old syntax, and then set
clip-to-width, orientation etc using the new, dynarray syntax.

Anne Wainwright wrote:
Quote:
Hi all, (and best for 2009)

I had to cure a problem of printing a report, the windows default
printer driver would pop up each time and (on Pdox alone,and only late
this past year) it decided to start with a postcard sized default paper
size. No way to keep the default at A4 and clip-to-width set.

Looking at the pdox examples I saw the PrinterOptionInfo type variable
which allowed to set certain requirements, and the ReportPrintInfo type
which allowed to set others, with some overlap. Neither would set all that
I wanted. Yet the examples shown for each both concluded with
print(varname). Thus I saw an either-or situation.

I did quite easily get it to work, and my basic code structure is here

var
prnOptions PrinterOptionInfo
repInfo ReportPrintInf0
; other var items
endVar

; set printer options showing overlap item and wanted item
prnOptions.Orientation = prnPortrait
prnOptions.PaperSize = prnA4

; set report printing options showing overlap item and wanted item
repInfo.orient = PrintPortrait
repInfo.panelOptions = PrintClipToWidth

; lots of other code follows to generate report thisbuy.rsl

if printerSetOptions(prnOptions) then
thisbuy.print(repInfo)
else
errorShow ("Could not set printer options.")
endIf

; more code

thus I left the printerSetOptions as just set and 'printed' the repInfo
ones. I didn't try it the other way around, but this seemed the 'right'
thing to try.

Well it works fine, but any comments welcome on this small matter. Is
this the best approach, are the two variable each typically used under specific
circumstances?

regards
Anne



--
Tom Krieg

---------------
http://www.krieg.com.au
Please use the contact page to contact me via email


Reply With Quote
  #5  
Old   
Anders
 
Posts: n/a

Default Re: PrinterOptionInfo and ReportPrintInfo variables - 01-23-2009 , 01:05 AM



Quote:
Well it works fine, but any comments welcome on this small matter. Is
this the best approach, are the two variable each typically used under
specific
circumstances?
I think the version of Paradox is essential to the answer. In my experience
there are som important differences how printing is handled in P7, P8 and
P10 (the versions I have experience from). What works in one version might
fail in another.

I use P10 and the syntax with an array and it seems to work for me.

Anders





Reply With Quote
  #6  
Old   
Anne Wainwright
 
Posts: n/a

Default Re: PrinterOptionInfo and ReportPrintInfo variables - 01-23-2009 , 02:03 PM



Anders, hello,

see below

On Fri, 23 Jan 2009 08:05:37 +0100, Anders wrote:

Quote:
Well it works fine, but any comments welcome on this small matter. Is
this the best approach, are the two variable each typically used under
specific
circumstances?

I think the version of Paradox is essential to the answer. In my experience
there are som important differences how printing is handled in P7, P8 and
P10 (the versions I have experience from). What works in one version might
fail in another.

I use P10 and the syntax with an array and it seems to work for me.
Just to be awkward I am running version 9

Anne

Quote:
Anders


Reply With Quote
  #7  
Old   
Anders
 
Posts: n/a

Default Re: PrinterOptionInfo and ReportPrintInfo variables - 01-26-2009 , 02:44 AM




Quote:
Just to be awkward I am running version 9

As I'm not using P9 I'm not sure, but I think P9 handles printing
differently than P10. The syntax with the dynamic array was added in P10.
But I could be wrong.

Anders




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.