DataSource with multiple results

Stimulsoft Ultimate discussion
Post Reply
luis.borges
Posts: 3
Joined: Wed Apr 25, 2018 1:21 pm

DataSource with multiple results

Post by luis.borges »

Hi,

I am creating a report that executes a stored procedure that returns multiple tables/resultsets.
When I create a DataSet in the report and execute de procedure, I get only the last table returned by the procedure. Is there a way to get all the tables returned by the procedure?

The procedure would be like:

CREATE PROCEDURE dbo.ReportTeste
AS
BEGIN
SELECT * FROM TABLE1

SELECT * FROM TABLE1
END
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: DataSource with multiple results

Post by Edward »

Hi Luis,

The Datasource in the report Dictionary pulls the data from the stored procedure and then converts it to the DataTable. And the DataTable represents the inner structure of the DataSource. As a workaround you could do any of the following:
1) adjust your stored procedure to accept a parameter that would return different subset of data, but always with the same columns set. So you could have 2 DataSources that have 2 different hard-coded parameters in them, or you could have one DataSource with dynamic value for that parameter:

Code: Select all

exec ReportTeste @myParameter
2) Use UNION in your stored procedure to join all the results and to return them in one table. In the report you could filter the data using the DataBand filtering.

There is no way to return all the tables for one DataSource.

Thank you,
Edward
Post Reply