Possible to change default report preview zoom factor?

Possible to change default report preview zoom factor?

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Possible to change default report preview zoom factor?

Postby nageswaragunupudi » Sat Jun 29, 2019 8:31 am

Code: Select all  Expand view

// 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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Possible to change default report preview zoom factor?

Postby James Bott » Sat Jun 29, 2019 3: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Possible to change default report preview zoom factor?

Postby nageswaragunupudi » Sat Jun 29, 2019 3: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
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Possible to change default report preview zoom factor?

Postby James Bott » Sat Jun 29, 2019 3: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Possible to change default report preview zoom factor?

Postby nageswaragunupudi » Sat Jun 29, 2019 4:14 pm

Mr. James

Please do these changes to rpreview.prg.

1) Add CLASSDATA bSetup
2) In the METHOD Activate()
After this code:
Code: Select all  Expand view

   if ::oWnd == nil
      return nil
   endif
 


and before
Code: Select all  Expand view

   ACTIVATE WINDOW ::oWnd MAXIMIZED ;
 


Add these lines:
Code: Select all  Expand view

   if ::bSetUp != nil
      Eval( ::bSetUp, Self, ::oWnd )
   endif
 


Then you can adopt the solution I posted above.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 108 guests