Add custom button to report viewer no longer working

Stimulsoft Reports.WEB discussion
Post Reply
ChrisHolland
Posts: 45
Joined: Tue May 21, 2019 1:44 pm

Add custom button to report viewer no longer working

Post by ChrisHolland »

using the example here:

https://www.stimulsoft.com/en/samples/ ... he-viewer

the code appears to fail in the latest release.

Tracing through the code it appears that the ReportViewer no longer has a collection called "images" so this line fails..

Code: Select all

	var customButton = jsStiWebViewer1.SmallButton("customButton", "Custom Button", "emptyImage");
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Add custom button to report viewer no longer working

Post by HighAley »

Hello, Chris.

We have added support of High DPI to our product.
Here is the right code:

Code: Select all

jsStiWebViewer1.onready = function(){ var customButton = jsStiWebViewer1.SmallButton("customButton", "Custom Button", "emptyImage");
customButton.image.src = "https://www.stimulsoft.com/favicon.png";
customButton.action = function () {
    alert("Custom Button Event");
}
 
var toolbarTable = jsStiWebViewer1.controls.toolbar.firstChild.firstChild;
var buttonsTable = toolbarTable.rows[0].firstChild.firstChild;
var customButtonCell = buttonsTable.rows[0].insertCell(0);
customButtonCell.appendChild(customButton); }
We will update our samples.

Thank you.
Post Reply