custom button in asp.net core designer

Stimulsoft Reports.WEB discussion
Post Reply
Mike Avan
Posts: 2
Joined: Sun Aug 17, 2025 4:51 pm

custom button in asp.net core designer

Post by Mike Avan »

Hi
We are evaluating your asp.net core reporting component.

How can I add a custom button from js, to the designer on a razor page and then execute an action.
Any example code is appreciated.
Thanks
Lech Kulikowski
Posts: 7351
Joined: Tue Mar 20, 2018 5:34 am

Re: custom button in asp.net core designer

Post by Lech Kulikowski »

Hello,

You can use the following code:

Code: Select all

<script type="text/javascript">
 
    jsStiNetCoreDesigner1.onready = function () {
     
    var homePanel = jsStiNetCoreDesigner1.options.homePanel;

    var buttonsGroup = jsStiNetCoreDesigner1.GroupBlock("buttonsGroup1", "Group1");
    var buttonsGroupTable = jsStiNetCoreDesigner1.GroupBlockInnerTable();
    buttonsGroup.container.appendChild(buttonsGroupTable);

    var customBigButton = jsStiNetCoreDesigner1.BigButton("customButton1", null, "Custom Button", " ", "Tooltip for customButton1");
    customBigButton.image.src = "https://www.stimulsoft.com/images/blocks/ultimate-buttons/logo.png";

    buttonsGroupTable.addCell(customBigButton).style.padding = "2px";

    customBigButton.action = function () {
	    alert("customButton was pressed!");
    }

    homePanel.firstChild.addCell(buttonsGroup);
    homePanel.firstChild.addCell(jsStiNetCoreDesigner1.GroupBlockSeparator());

    }

</script>
Thank you.
Mike Avan
Posts: 2
Joined: Sun Aug 17, 2025 4:51 pm

Re: custom button in asp.net core designer

Post by Mike Avan »

Hello,
And how do you add button to be the first not the last as the above script suggests?
Thank you
Post Reply