Page 1 of 1
Possible to change default report preview zoom factor?
Posted: Fri Jun 28, 2019 11:47 pm
by James Bott
Is there a way to change the report preview default zoom factor from 0 to 1 using code?
The default full page view is too small to read, so I would like to zoom in one level without having to double-click each time.
I already searched the forum.
Any ideas?
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 8:31 am
by nageswaragunupudi
Code: Select all
// Somewhere in your program before creating the report
TPreview():bSetup := { |oRep,oWnd| RepZoom( oRep, oWnd ) }
// <other code, create report, whatevr
function RepZoom( oRep, oWnd )
oWnd:bInit := { || oRep:Zoom() }
return nil
Please try and provide your feedback.
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 3:13 pm
by James Bott
Nages,
Thanks but It errors out:
TPreview():setup message not found.
Maybe due to my older version of FW (18.05).
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 3:23 pm
by nageswaragunupudi
TPreview():bSetup
not Setup.
But yes, this data is not available in FWH1812.
You may need to modify Activate() method of RPreview.prg and insert this ::oWnd:bInit
before the command
ACTIVATE ::oWnd ....
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 3:38 pm
by James Bott
TPreview():bSetup
not Setup.
Ah, TPreview:setup was mistyped by me in my message but it was correct in my code.
Can't test it now, but I will try your suggestion later today--probably tommorow morning your time.
Thanks for the quick response.
James
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 4:14 pm
by nageswaragunupudi
Mr. James
Please do these changes to rpreview.prg.
1) Add CLASSDATA bSetup
2) In the METHOD Activate()
After this code:
Code: Select all
if ::oWnd == nil
return nil
endif
and before
Code: Select all
ACTIVATE WINDOW ::oWnd MAXIMIZED ;
Add these lines:
Code: Select all
if ::bSetUp != nil
Eval( ::bSetUp, Self, ::oWnd )
endif
Then you can adopt the solution I posted above.