Setting viewer zoom in code

Stimulsoft Reports.NET discussion
Post Reply
jmiller
Posts: 91
Joined: Mon Sep 20, 2010 12:18 pm

Setting viewer zoom in code

Post by jmiller »

I want to set the initial zoom factor of my report in the viewer. I can't seem to find any way to do this. I do not use the viewer control itself, but make a call to Show as a dialog form.

StiReport myReport;
...
myReport.Show(true);
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Setting viewer zoom in code

Post by HighAley »

Hello.
jmiller wrote:I want to set the initial zoom factor of my report in the viewer. I can't seem to find any way to do this. I do not use the viewer control itself, but make a call to Show as a dialog form.

StiReport myReport;
...
myReport.Show(true);
For setting zoom level you can use next code.

Code: Select all

   StiReport myReport;
   StiOptions.Viewer.Windows.Zoom = 0.5; // 50% zoom
   myReport.Show(true);
To set zoom level to 100% you must set Zoom property to 1.

Thank you.
jmiller
Posts: 91
Joined: Mon Sep 20, 2010 12:18 pm

Setting viewer zoom in code

Post by jmiller »

Worked perfectly! Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Setting viewer zoom in code

Post by HighAley »

We are always glad to help you.
Post Reply