Update contents of STIText

Stimulsoft Reports.JS discussion
Post Reply
ADev2000
Posts: 5
Joined: Tue Jul 16, 2019 8:36 pm

Update contents of STIText

Post by ADev2000 »

Hello,
I am trying modify value in rendered report. I followed the example provided in your website
1) copied over stimulsoft.reports.js and stimulsoft.viewer.js to src\stimulsoft
2) added ref to angular.json file "scripts": [
"src/app/stimulsoft/stimulsoft.reports.js",
"src/app/stimulsoft/stimulsoft.viewer.js"
]

3) In app component added following code
var report = new Stimulsoft.Report.StiReport();

report.loadFile("reports/MyReport.mrt");

var options = new Stimulsoft.Viewer.StiViewerOptions();

options.appearance.fullScreenMode = false;

var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);

viewer.report = report;

report.render();

var tt = report.renderedPages.getComponentByName("Text18") as Stimulsoft.Report.StiText; // Here is the ERROR

tt.text = "NEW TEXT FROM CODE";

viewer.renderHtml("viewer");

When I do ng-serve, I get an error (ERROR in src/app/abc-xyz/abc-xyz.component.ts(374,67): error TS2503: Cannot find namespace 'Stimulsoft'.), but when I browse to the page, I see the correct results (I see the text box with the text NEW TEXT FROM CODE)

Please let me know how I can resolve this issue
Lech Kulikowski
Posts: 7292
Joined: Tue Mar 20, 2018 5:34 am

Re: Update contents of STIText

Post by Lech Kulikowski »

Hello,

Please send us a sample project which reproduces the issue for analysis.

Thank you.
Post Reply