Zoom in viewer

Stimulsoft Reports.JS discussion
Post Reply
jpgb
Posts: 67
Joined: Tue Mar 15, 2016 11:42 am

Zoom in viewer

Post by jpgb »

Can i change the viewer toolbar zoom after displaying the report in the viewer?

JB
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Zoom in viewer

Post by Alex K. »

Hello,

You can use following actions:
viewer.jsObject.postAction(action);
action is a string value:
"FirstPage"
"PrevPage"
"NextPage"
"LastPage"
"FullScreen"
"Zoom25"
"Zoom50"
"Zoom75"
"Zoom100"
"Zoom150"
"Zoom200"
"ZoomOnePage"
"ZoomPageWidth"
"About"
"Design"

Thank you.
jpgb
Posts: 67
Joined: Tue Mar 15, 2016 11:42 am

Re: Zoom in viewer

Post by jpgb »

Thanks Aleksey, but the problem still continues.

Basically, i want the report to adjust to the viewer area to see the whole report

this should work (i think) - viewer.jsObject.postAction("ZoomPageWidth");

When the report orientation is 0, it works fine, but with reports with orientation 1, you will not see part of the map.

I had to do something like this:

if (report.pages.getByIndex(0).orientation==0)
viewer.jsObject.postAction("ZoomPageWidth");
else
viewer.jsObject.postAction("Zoom75");
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Zoom in viewer

Post by Alex K. »

Hello,

Please try to use the "ZoomOnePage" for the landscape page orientation.
Or try to use the following code:

Code: Select all

var options = new Stimulsoft.Viewer.StiViewerOptions();
//options.toolbar.zoom = -1; // zoom by width (orientation 0)
options.toolbar.zoom = -2; // zoom by height (orientation 1)
Thank you.
Post Reply