We have an existing project in MVC and the stimulsoft reports with stiMvcViewer are working fine there, respected to the new request we are converting our application to Single Page App framework and for this we need to convert the StimulSoft reports so as to render those at HTML pages. I got to know on this forum that the old xml based .mrt files are supported by Reports.js, hence we have kept the .mrt files as it is and replaced the stiMvcViewer with Reports.js methods.
When I call the report.loadfile(report path), it reads most of the information as I can see debugging the report object at client side, but the datasource is not getting loaded under the dictionary.
I'm attaching the .mrt file please have a look and let me know if anything needs to be changed.
Code I'm using to render and fill the report:
Code: Select all
$scope.report = new Stimulsoft.Report.StiReport();
$scope.report.loadFile("../../../" + reportParam.report.path);
angular.forEach(reportParam.report.reportParams, function (rParam) {
if (rParam.selectParam == "y" || rParam.selectParam == "b")
{
switch (rParam.paramtype)
{
case "0":
$scope.report.setVariable(rParam.paramname, string.IsNullOrEmpty(rParam.value) ? "true" : rParam.value);
break;
case "11":
$scope.report.setVariable(rParam.paramname, rParam.value);
break;
case "10":
//report[rParam.paramname] = form["serialParamVal"];
break;
}
}
});
$scope.report._dictionary._databases.clear();
$scope.report._dictionary._databases.add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Conn", reportParam.connectionString));
var options = new Stimulsoft.Viewer.StiViewerOptions;
options.appearance.backgroundColor =
Stimulsoft.System.Drawing.Color.dodgerBlue;
options.toolbar.showAboutButton = false;
options.exports.showExportToPdf = true;
options.exports.ShowExportToWord2007 = true;
options.toolbar.showParametersButton = false;
var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
viewer.report = $scope.report;
viewer.renderHtml("viewerContent");