Viewer template update after design change

Stimulsoft Reports.JS discussion
Post Reply
Viktor
Posts: 4
Joined: Tue Apr 18, 2017 3:38 pm

Viewer template update after design change

Post by Viktor »

Hello all,

Currently after we change something in the designer(lets say the font of the title), save the changes and exit from the designer the changes are not applied to the viewer until I generate a new report.

I fixed the problem this way:

Code: Select all

designer.onExit = function( event ) {
                this.visible = false;

                report = new $window.Stimulsoft.Report.StiReport();
                report.load( reportTemplate );
                report.regData( "ReportData", "ReportData", $stateParams.data.data );

                viewer.report = report;
                viewer.visible = true;
            };
reportTemplate is the new template that should be applied.

So my question is if there is a better way to do this, because at the moment everytime someone exit the designer I create a new instance for the report variable. I'm not sure if thats the right way.

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

Re: Viewer template update after design change

Post by Alex K. »

Hello,

You can use your solution ar the following:

Code: Select all

designer.onExit = function(event) {
  viewer.report = designer.report;
}
Thank you.
Post Reply