Hi -

Most are probably aware of the "Viewer comes up 3 miles wide by 2 high"
issue in 12.1 & 14. You're probably also aware of the white paper on how to
bring it up maximized so this doesn't happen.

I had an issue with that solution because of training users which "X" to hit
to close the report - as they (OK - I've done it too ;-) often close the
whole app by accident. Especially when no other views, etc. come up
maximized, having one thing act this way just didn't seem right, so I messed
with the code below to allow a normal non-maximized window for viewing.

It ain't perfect, but it comes up (in testing done so far) as a normal
window & only a vertical scrollbar in the viewer (as one would expect with
multiple pages in the report) in 1024x768, 1440x900, & 3080x1280. No
scrollbars in the MDI container.

I think you could easily make the width 0.25 instead of 0.2 - but we've got
someone with 2 24" monitors side by each. (making for the 3 to 1 aspect
ration above).

You'll also note that the bottom margin is 10 lower, as this made for a
smaller gray bar across the bottom - allowing one more line of viewing + it
better matches the scrollbar width on the right.

Thanks to Doug Lawson for working on this with me & hope this helps
someone -


Procedure Construct_Object
Boolean bAttached
Handle hoViewer hoCliArea
Integer iYX iY iX

Forward Send Construct_Object

// Display report at 100%
Set piZoom to 100

// Get the gui size of the client area
Get Parent to hoCliArea
Get GUISize of hoCliArea to iYX
Move (hi(iYX)) to iY
Move (low(iYX)) to iX

// Set RDC Previewer sizes
Get phoActiveXReportViewer to hoViewer
// Set to Percentage so it'll work on most monitors w/out being maximized &
does not create horizonatal scrollbar
// Set GUISize to (iY-2) (iX-2)
Set GUISize to (iY-(iY*.075)) (iX-(iX*.2))
Send Adjust_Logicals
//Bottom Margin set smaller for better appearance
// Set Size of hoViewer to (Hi(Size(Self))-21) (Low(Size(Self))-6)
Set Size of hoViewer to (Hi(Size(Self))-11) (Low(Size(Self))-6)
End_Procedure // Construct_Object

//Displays report in the maximized preview control.
Procedure DisplayReport Handle hoReport
Handle hoViewer
Get phoActiveXReportViewer to hoViewer
If (hoViewer) Begin
//Changed GUISize above so we don't have to maximize
// Set View_Mode of (Self) to Viewmode_Zoom
Set View_Mode of (Self) to Viewmode_Normal
Forward Send DisplayReport hoReport
End_Procedure // DisplayReport