Reputation: 8584
In SQL Server Reporting Services
, I was able to make a report that accessed SQL Server
via a stored procedure. In this stored procedure, I passed along a parameter and the stored procedure returned only data related to that parameter. This worked correctly.
Is it possible to, take that same parameter and pass it to another stored procedure so that 2 different reports on queried and returned at the same time, while being displayed on the same report?
For example:
Stored Procedure 1:
Parameter passed to Stored Procedure 1: OrderID
Returns Data 1
Stored Procedure 2:
Parameter passed to Stored Procedure 1: OrderID
Returns Data 2
Report:
Data1
Data2
Upvotes: 1
Views: 5988
Reputation: 3750
If the columns returns are the same for both the stored procedures then.
You can also create one more stored procedure that takes this parameter's value.
Exec both the stored procedure1 and stored procedure2 based on the parameter value.
Advantage Here You dont need to create the two tables in the report.
LINK: UNION the results of multiple stored procedures
This link helps in UNION of the two or more stored procedures result.
Upvotes: 0
Reputation: 37388
Yes, you can do this by creating an additional dataset, so that you have one dataset for each stored procedure call.
If your report then contains two tables, each table could then reference one of the datasets.
Upvotes: 3