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
DataSource with multiple results
-
- Posts: 3
- Joined: Wed Apr 25, 2018 1:21 pm
Re: DataSource with multiple results
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:
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
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
There is no way to return all the tables for one DataSource.
Thank you,
Edward