Using Stored Procedure In Reporting

I am currently utilizing some stored procedures to populate tables within the Ignition Designer.

I want to utilize the result sets in a table and pie object in the Report Viewer but it looks to me like the Script option data source does not support this in the function that’s provided.

How would I go about returning a data set from SQL Server into the Report Viewer?

You can just put the name of a stored procedure inside the Basic SQL Query datasource type.
I just tested it with a single parameter SP.

NameOfMyStoredProcedure MyParameter

What does the syntax look like? I had been using something like this:

call = system.db.createSProcCall(“sproc”)
call.registerInParam(“p1”, system.db.TIMESTAMP, var1)
call.registerInParam(“p2”, system.db.TIMESTAMP, var2)
system.db.execSProcCall(call)

data = call.getResultSet()

Literally MyStoredProcedureName ‘MyStringParameter’

3 Likes

It works - so simple it went right over my head

2 Likes

Good morning,
if I have more parameters for store procedure, how can I send them?

I’m try to do in this mode :

spReportAnalisiFermate {pDateStart} {pDateEnd} {pGplant_AS} {pMachine_AS} {plang} {pCod_MacroStp_AS} {pZone_Prod_AS}

in this mode only errors

Separate them with commas

spReportAnalisiFermate {pDateStart},{pDateEnd},{pGplant_AS},{pMachine_AS},{plang},{pCod_MacroStp_AS},{pZone_Prod_AS}

i get this error…

Change your Query Type to Basic SQL Query

1 Like

I have try to put Basic SQL Query, now error is go away but a new error is on.

How i can debug these?

Post the new error and a screenshot of your report data tab