Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DW Print Preview Zoom: Fit Page Width??

7 views
Skip to first unread message

Tom Hansen

unread,
Dec 15, 1998, 3:00:00 AM12/15/98
to

Is there an easy way to implement "Fit Page Width" in a Datawindow Print
Preview Zoom setting?

I.e.: When a datawindow is in Print Preview mode, is there a way to
query it to find out what the physical page width is, so that I can then
set the print preview zoom so that the page just fits in the window?

THANKS!!


--
Tom Hansen
to...@execpc.NOSPAMcom
http://www.execpc.com/tomh

Chris Gross

unread,
Mar 29, 1999, 3:00:00 AM3/29/99
to

There is a way to create "Fit Height" and "Fit Width" buttons. The trick is
checking the datawindow properties called verticalscrollmaximum and
horizontalscrollmaximum. When these properties are equal to "0" then the
scroll bars are not visible, ie. the width fits or the height fits. So you
will need to programmatically alter the zoom up or down appropriately.
Below is an example of a "Fit Width".

boolean lb_shrink

setpointer(hourglass!)
dw_report.setredraw(false)

if dw_report.object.datawindow.horizontalscrollmaximum <> "0" then lb_shrink
= TRUE

if lb_shrink then

Do Until dw_report.object.datawindow.horizontalscrollmaximum = "0"
dw_report.object.datawindow.print.preview.zoom =
integer(dw_report.object.datawindow.print.preview.zoom) - 1
Loop

else

Do Until dw_report.object.datawindow.horizontalscrollmaximum <> "0"
dw_report.object.datawindow.print.preview.zoom =
integer(dw_report.object.datawindow.print.preview.zoom) + 1
Loop
dw_report.object.datawindow.print.preview.zoom =
integer(dw_report.object.datawindow.print.preview.zoom) - 1

end if

dw_report.setredraw(true)

return


Be careful though. This operation is sometimes very CPU intensive and can
cause a noticeable pause. Sorry for the late response but I hope you can
still use the technique.

Chris Gross
PB Developer's Station - http://www.geocities.com/~cgross1

Tom Hansen wrote in message <3676E134...@execpc.com>...

0 new messages