Page 1 of 1

Update contents of STIText

Posted: Tue Jul 16, 2019 8:46 pm
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

Re: Update contents of STIText

Posted: Tue Jul 16, 2019 9:58 pm
by Lech Kulikowski
Hello,

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

Thank you.