Page 1 of 1

Get Info about zoom and viewMode

Posted: Thu Jan 03, 2019 7:36 am
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

Re: Get Info about zoom and viewMode

Posted: Thu Jan 03, 2019 2:27 pm
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.