registerCustomDatabase with Promise

Stimulsoft Reports.JS discussion
Post Reply
zvondic
Posts: 1
Joined: Mon Oct 14, 2019 7:19 am

registerCustomDatabase with Promise

Post by zvondic »

I have a this code in angular module:

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
  }
   
It is'not work. There is some error:

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)
What can be problem ?

Thanks Josef.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: registerCustomDatabase with Promise

Post by HighAley »

Hello.

What version of our product do you use?
Could you upgrade to the latest build.

Thank you.
Post Reply