Get Info about zoom and viewMode

Stimulsoft Reports.JS discussion
Post Reply
PWeber
Posts: 1
Joined: Thu Jan 03, 2019 7:24 am

Get Info about zoom and viewMode

Post by PWeber »

Hello,

how can i get the info about current zoom-level and view-mode in the ReportViewer?

Is there any event that fires when zoom-level or view-mode is changed?
I want to store the info per user to initialize the Viewer next time with these settings.

Thank you
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Get Info about zoom and viewMode

Post by HighAley »

Hello,

Here is a client-side code that will help you to get necessary information:

Code: Select all

var viewer = new Stimulsoft.Viewer.StiViewer(viewerOptions, "StiViewer", false);
            viewer.renderHtml("content");

            viewer.jsObject.oldPostAction = viewer.jsObject.postAction;

            viewer.jsObject.postAction = function (action, bookmarkPage, bookmarkAnchor, componentGuid) {
                if (action && ((action.indexOf("ViewMode") == 0 && action != "ViewMode") || (action.indexOf("Zoom") == 0 && action != "Zoom"))) {
                    alert(action);
                    //write your code here
                }
                viewer.jsObject.oldPostAction(action, bookmarkPage, bookmarkAnchor, componentGuid);
            }
Let us know if you need additional description.

Thank you.
Post Reply