registerCustomDatabase with Promise
Posted: Wed Apr 15, 2020 9:45 am
I have a this code in angular module:
It is'not work. There is some error:
What can be problem ?
Thanks Josef.
Code: Select all
Stimulsoft.Report.Dictionary.StiCustomDatabase.registerCustomDatabase({
serviceName: "M-database",
sampleConnectionString: "*",
process: (command, callback) => {
console.log(command);
callback(this.getData(id, command));
}
})
async getData(reportId, command): Promise<any> {
let options = new SaveOptions()
options.params = { id: reportId, command: command }
let msg: MessageIn = await QEWDInstance.executeSync('Data.General.Report', command.command, options)
return msg
}
Code: Select all
core.js:5882 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'indexOf' of null
TypeError: Cannot read property 'indexOf' of null
at HTMLDivElement.e.show (stimulsoft.designer.js:21)
at Function.i.showError (stimulsoft.reports.js:45)
at gt.<anonymous> (stimulsoft.reports.js:66)
at r (stimulsoft.reports.js:49)
at Object.throw (stimulsoft.reports.js:49)
at i (stimulsoft.reports.js:49)
at ZoneDelegate.invoke (zone-evergreen.js:365)
at Object.onInvoke (core.js:41277)
at ZoneDelegate.invoke (zone-evergreen.js:364)
at Zone.run (zone-evergreen.js:124)
at resolvePromise (zone-evergreen.js:793)
at zone-evergreen.js:707
at i (stimulsoft.reports.js:49)
at ZoneDelegate.invoke (zone-evergreen.js:365)
at Object.onInvoke (core.js:41277)
at ZoneDelegate.invoke (zone-evergreen.js:364)
at Zone.run (zone-evergreen.js:124)
at zone-evergreen.js:851
at ZoneDelegate.invokeTask (zone-evergreen.js:400)
at Object.onInvokeTask (core.js:41255)
Thanks Josef.