Here is the angular code:
Code: Select all
onConnectorsGridModalClosed(selectedConnector: any) {
this.isConnectorsGridModalOpen = false;
this.selectedConnector = selectedConnector;
if (this.selectedConnector) {
this.reportService.getData(this.selectedConnector.id) // this end-point is returning a json data
.subscribe((result) => {
let dataSet = new Stimulsoft.System.Data.DataSet(this.selectedConnector.name);
dataSet.readJson(result);
// this is adding the dataSource, I can see it in this.designer.report.dictionary.dataSources and it is calling back-end as we expected.
this.designer.report.regData(this.selectedConnector.name, this.selectedConnector.name, dataSet);
this.designer.report.dictionary.synchronize();
// following lines are working. I can see the newly added datasource in dictionary panel. But everytime, it is adding latest selected, and removing already exists.
// let report = new Stimulsoft.Report.StiReport();
//
// report.regData(this.selectedConnector.name, this.selectedConnector.name, dataSet);
// report.dictionary.synchronize();
// this.designer.report = report;
});
}
}