I have imported a crystal report, which had 4 XML data sources which the Import Wizard of Standalone Report Designer has correctly converted to 4 SQL Data Sources.
Now, I must assign 4 SQL Server Stored Procedures (returning a dataset), 1 each for the 4 SQL Data Sources. Each stored procedure has some parameters. I can do this in the Configure Data Source Command window by selecting Stored Procedure.
My problem is that the SQL Database is determined at runtime. i.e. there are two databases having the same 4 stored procedures. So, it becomes a Dynamic command. So, I have to use "Select Statement" and not the "Stored Procedure" in the Command window.
It becomes something like EXEC {DBName}.[dbo].[StoredProc1] @prm1, @prm2 for 1st Data Source, EXEC {DBName}.[dbo].[StoredProc2] @prm for the second and so on for others.
DBName is determined at runtime. If there was only 1 SQL Data Source, I would have created a report parameter and created a binding like DataSource.SelectCommand= Format("{0}.[dbo].[StoredProc1]", Parameters.DBName.Value)
However, since there are 4 SQL Data Sources with each having a different stored procedure as its command, I cannot do this.
Any idea as to how to proceed in this situation?