Undisplay a part of the Designer on Create Report

Stimulsoft Reports.JS discussion
Post Reply
PaPy
Posts: 34
Joined: Fri May 19, 2017 1:51 pm

Undisplay a part of the Designer on Create Report

Post by PaPy »

Hi,

I overwritted the Designer.onCreateReport() to do the job I wanted. I want to do not display this part of the designer (see in attachement) I want when my customer click on File -> New my overwritted function onCreateReport() be triggered.

It is possible to undisplay this view ? Or just display the "blank Report" or my own templates...
Attachments
What_I_Want_To_Undisplay.PNG
What_I_Want_To_Undisplay.PNG (27.19 KiB) Viewed 5372 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Undisplay a part of the Designer on Create Report

Post by HighAley »

Hello.

Yes, you could remove any wizard and add your own templates.
Here is a sample code:

Code: Select all

            var designerId = "StiDesigner";
            var designer = new Stimulsoft.Designer.StiDesigner(options, designerId, false);
            designer.renderHtml("content");

            //---------------------
            var newReportPanel = designer.jsObject.options.newReportPanel || designer.jsObject.InitializeNewReportPanel();

            //Add custom image to designer images collection
            designer.jsObject.options.images["CustomButtonImage"] = "https://www.google.by/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png";

            //Create new button
            var customBigButton = designer.jsObject.NewReportPanelButton("customReportButton", "My Button", "CustomButtonImage");
            customBigButton.image.style.width = "150px";
            customBigButton.image.style.height = "200px";

            //Remove old wizard buttons
            newReportPanel.removeChild(newReportPanel.childNodes[1]);

            //Add new button
            var buttonsTable = designer.jsObject.CreateHTMLTable();
            buttonsTable.style.marginLeft = "20px";
            newReportPanel.appendChild(buttonsTable);
            buttonsTable.addCell(customBigButton);

            //Click event
            customBigButton.action = function () {
                var fileMenu = this.jsObject.options.menus.fileMenu || this.jsObject.InitializeFileMenu();
                fileMenu.changeVisibleState(false);
                setTimeout(function () {
                    //Write your code here
                    alert("customReportButton was clicked!");
                }, 200);
            }
            //------------------
Thank you.
PaPy
Posts: 34
Joined: Fri May 19, 2017 1:51 pm

Re: Undisplay a part of the Designer on Create Report

Post by PaPy »

Great ! Thanks for your answer HighAley. :)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Undisplay a part of the Designer on Create Report

Post by Alex K. »

Hello

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

Thank you.
PaPy
Posts: 34
Joined: Fri May 19, 2017 1:51 pm

Re: Undisplay a part of the Designer on Create Report

Post by PaPy »

Hello,

I discovered something that's bother me. I succeeded to use my own reportPanel but when I change the language of the interface I got the default reportPanel, so I lost my own reportPanel. I have to refresh if I want to see it again.

Is there a way to catch the changeLanguage event and recreate my own reportPanel ? Or a way to prevent this event to reset the default reportPanel ?

Thanks in advance.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Undisplay a part of the Designer on Create Report

Post by Alex K. »

Hello,

Could you please send us a simple project which reproduces the issue for analysis.

Thank you.
PaPy
Posts: 34
Joined: Fri May 19, 2017 1:51 pm

Re: Undisplay a part of the Designer on Create Report

Post by PaPy »

Hello,

I attached a sample project that reproduce the bug.

Here the steps :
  • Go to File -> New. You'll see my own reportPanel ;
  • Return to the report edition ;
  • On the right top on the screen, select an other language ;
  • Go to File -> New. My own reportPanel is lost. You'll see the default reportPanel.
I want to keep my own reportPanel.
Attachments
sample_project.zip
(4.95 MiB) Downloaded 468 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Undisplay a part of the Designer on Create Report

Post by HighAley »

Hello.

We have reproduced the issue.
We need some time to find a solution for you.

Thank you.

Ticket reference: #4749.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Undisplay a part of the Designer on Create Report

Post by HighAley »

Hello.

We have made some changes in your file.
Please, try it.

Thank you.
Attachments
demo.zip
(1.58 MiB) Downloaded 342 times
Post Reply