FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible to change default report preview zoom factor?
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Possible to change default report preview zoom factor?
Posted: Fri Jun 28, 2019 11:47 PM

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?

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 08:31 AM
Code (fw): Select all Collapse
// 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.
Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 03:13 PM
Nages,

Thanks but It errors out:

TPreview():setup message not found.

Maybe due to my older version of FW (18.05).
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 03:23 PM

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 ....

Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 03:38 PM
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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Possible to change default report preview zoom factor?
Posted: Sat Jun 29, 2019 04:14 PM
Mr. James

Please do these changes to rpreview.prg.

1) Add CLASSDATA bSetup
2) In the METHOD Activate()
After this code:
Code (fw): Select all Collapse
   if ::oWnd == nil
      return nil
   endif


and before
Code (fw): Select all Collapse
   ACTIVATE WINDOW ::oWnd MAXIMIZED ;


Add these lines:
Code (fw): Select all Collapse
   if ::bSetUp != nil
      Eval( ::bSetUp, Self, ::oWnd )
   endif


Then you can adopt the solution I posted above.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion