Стимулсофт с JavaScript
У меня есть проект, который для сообщения об этом в Stimulsoft нужно добавить данные из 2 таблиц. Я пишу этот код, но он не работает с 2 таблицами, однако он работает правильно с 1 таблицей в DataSource. Я использую 2 таблицы в этом коде, чтобы показать вам:
$(document).ready(function () {
function gotoProjectLoginPage() {
window.location = window.location.hostname + "/login/";
}
let url = window.location.href.split("?")[1];
let idP = runAjax("ProjectWSL", "GetProjectIDByURL", { url: url.slice(0, 6) }); //reading Data from DB
var result = runAjax("ProjectWSL", "GetReportProject", { projectID: idP }); // reading Data from DB
result = JSON.stringify(result);
result = "{\"Value\" :" + result + "}";// Set Name of table1 in
Datasource as value
result = JSON.parse(result);
var resultOther = runAjax("ProjectWSL", "GetProjectReportOtherCost", { projectID: idP }); // reading Data from DB
resultOther = JSON.stringify(resultOther);
resultOther = "{\"Other\" :" + resultOther + "}";//Set Name of table2 in
Datasource as Other
resultOther = JSON.parse(resultOther);
var report = new Stimulsoft.Report.StiReport();
report.loadFile("/UIL/report/ReportProject5.mrt");
report.dictionary.databases.clear();
var dataSet = new Stimulsoft.System.Data.DataSet('Zardis');
result = JSON.stringify(result);
resultOther = JSON.stringify(resultOther);
dataSet.readJson(resultOther);
dataSet.readJson(result);
report.regData('Zardis','Zardis' , dataSet);
report.dictionary.synchronize();
report.render();
var viewer = new Stimulsoft.Viewer.StiViewer(null, "StiViewer", false);
viewer.report = report;
viewer.renderHtml("viewerContent");
});[this image show how to create 2 table in datasource within stimulsoft program][1]