Possible to change default report preview zoom factor?

Post Reply
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Possible to change default report preview zoom factor?

Post 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?
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Possible to change default report preview zoom factor?

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

G. N. Rao.
Hyderabad, India
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Possible to change default report preview zoom factor?

Post by James Bott »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Possible to change default report preview zoom factor?

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

G. N. Rao.
Hyderabad, India
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Possible to change default report preview zoom factor?

Post 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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Possible to change default report preview zoom factor?

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

G. N. Rao.
Hyderabad, India
Post Reply