Page 1 of 1

Hide save and print button

Posted: Fri May 04, 2018 1:18 pm
by jpgb
I know how to hide them in the options object, but can i hide these buttons after the viewer is loaded?

thanks
JB

Re: Hide save and print button

Posted: Fri May 04, 2018 10:24 pm
by Edward
Hi JB,

Yes, that is possible as well. Please check out the following approach of adding a new button:

And you could hide a button in a similar fashion as well.

Code: Select all

<head>
    <script>
        var options = new Stimulsoft.Viewer.StiViewerOptions();
        var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
        var report = new Stimulsoft.Report.StiReport();
        report.loadFile("Reports/SampleReportWithEditableText.mrt");
        viewer.renderHtml("viewerCont");
        viewer.report = report;

        var toolbarTable = viewer.jsObject.controls.toolbar.firstChild;
        viewer.jsObject.controls.toolbar.removeChild(toolbarTable);

        var userToolbar = document.createElement("div");
        viewer.jsObject.controls.toolbar.appendChild(userToolbar);
        
        var userToolButton = document.createElement("div");
        userToolButton.style.background = "red";
        userToolButton.style.width = userToolButton.style.height = "25px";
        userToolbar.appendChild(userToolButton);

        userToolButton.onclick = function () {
            viewer.jsObject.postExport(exportType, viewer.jsObject.getDefaultExportSettings(exportType));
        }

    </script>
</head>
<body>
    <div id="viewerCont"></div>
</body>

Thank you,
Edward

Re: Hide save and print button

Posted: Sun May 06, 2018 12:43 pm
by jpgb
Thanks!

JB

Re: Hide save and print button

Posted: Tue May 08, 2018 7:44 am
by Lech Kulikowski
Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.