RS 2005 Report and SQL 2005 Stored Procedure
Hello, I have written a RS 2005 report which reads a SQL 2005 DB and associated dataset to retrieve and report financial data based on selected (via parameter) values. I also wrote a SQL 2005 Stored Procedure which I wish to run prior to the report executing. The SP populates the table used by the report. The parameters involved include one in the SP for fiscal year - char(4) which will prompt the user to enter a value. The SP then reads the DB and populates the table for reporting. Also, the report contains two parameters for selecting on accounting period RANGE, a beginning and ending value. I am attempting to run the SP as part of the Data Tab select statement(s) in the RS report. My question is : How do I define the SP parameters as well as the report parameters so everything can run in a sequential fashion and seamlessly? Also, is it possible to execute the SP from the Data Tab command logic in the report? Parameter examples: SP - @Year char(4) RS report - @Begin_PD @End_PD (both String type) Thanks in advance, Dan Curtis
June 9th, 2011 8:04pm

Hi micropterus_sal, If i understand Properly you have a SP which bring data from <<Report_SP>> which fetches data from <<Report_Table>> and <<Report_Table>> is Populated by <<Data_SP>> which you want to run before you can run <<Report_SP>>. What i would suggest is Execute the <<Data_SP>> inside the <<Report_SP>> so that your Table data Gets Populated first later your <<Report_SP>> will bring the Required Data from <<Report_Table>>. << Dont Forget to Mark it as Answered if found useful >> Rakesh M J
Free Windows Admin Tool Kit Click here and download it now
June 9th, 2011 11:55pm

Hi micropterus_sal, If i understand Properly you have a SP which bring data from <<Report_SP>> which fetches data from <<Report_Table>> and <<Report_Table>> is Populated by <<Data_SP>> which you want to run before you can run <<Report_SP>>. What i would suggest is Execute the <<Data_SP>> inside the <<Report_SP>> so that your Table data Gets Populated first later your <<Report_SP>> will bring the Required Data from <<Report_Table>>. << Dont Forget to Mark it as Answered if found useful >> Rakesh M J << Dont Forget to Mark it as Answered if found useful >> Rakesh M J
June 10th, 2011 6:43am

Hi micropterus_sal, If i understand Properly you have a SP which bring data from <<Report_SP>> which fetches data from <<Report_Table>> and <<Report_Table>> is Populated by <<Data_SP>> which you want to run before you can run <<Report_SP>>. What i would suggest is Execute the <<Data_SP>> inside the <<Report_SP>> so that your Table data Gets Populated first later your <<Report_SP>> will bring the Required Data from <<Report_Table>>. << Dont Forget to Mark it as Answered if found useful >> Rakesh M J
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2011 6:54am

Hi micropterus_sal, If i understand Properly you have a SP which bring data from <<Report_SP>> which fetches data from <<Report_Table>> and <<Report_Table>> is Populated by <<Data_SP>> which you want to run before you can run <<Report_SP>>. What i would suggest is Execute the <<Data_SP>> inside the <<Report_SP>> so that your Table data Gets Populated first later your <<Report_SP>> will bring the Required Data from <<Report_Table>>. << Dont Forget to Mark it as Answered if found useful >> Rakesh M J << Dont Forget to Mark it as Answered if found useful >> Rakesh M J
June 10th, 2011 1:40pm

Hi micropterus_sal, According to your description, I learned that you would like to execute the SP with parameter @Year first, and then the data in report is retrieved with two parameters @Begin_PD and @End_PD from a table which is populated from the SP, and you would like to get it achieved in Data tab command logic in report, right? Please correct me if my understanding is wrong. If in this case, I am afraid it cannot be achieved, the SP and RS report are executing at the same time. I suspect that when you put the SP in the Data tab, the reporting services processes the SP as a part of the report dataset. The T-SQL query execution is sequential (step by step), I suggest you could add the T-SQL of dataset in the last of the SP, and then set the SP as the dataset of the report. In another way, we could put the query which populate the table used by the report in the front of the SP, and put the query about how to retrieve data from the table in the last of the SP. If you have any question, please feel free to ask. Thanks, Eileen
Free Windows Admin Tool Kit Click here and download it now
June 16th, 2011 10:00am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics