Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to a different stored procedure at runtime

Status
Not open for further replies.

manishw

Programmer
Jun 15, 2005
16
US

Hello..
I am using Crystal Reports 10. Am running the report through some asp pages. The report is tied to a stored procedure at design time. Can I make the report connect to a different stored procedure at runtime? Both these stored procs have the same output in terms of columns. They differ only in the data.
Thanks,
Manish
 
Sorry but I don't quite understand why would you want to do that.

why don't you set the SP at design time and then publish it on your server?

Mo
 
Mo.. I wanted to save time on building another .rpt file which will have everything else same except the stored proc name. So wanted to check if it is possible to change the stored proc at runtime.

Manish
 
To the best of my knowledge I don't think you can

you can change Server & Database and CR will find the relevant Table, Stored Proc by itself.

what you can do is

1) rename the stored Proc on you report to something short

I always do that eg SP_GetThatData_1 = GTD, this way all your code will be easy to write.

all your fields will be like {GTD.Field1} and so on

Because you are not using the real name you should be able to remap another SP onto the report without having to do all the design stuff.

go to database<Set Datasource Location
and change the Stored proc there

the other Stored Proc will simply take on the name that you have given to the original and since the structure is the same you shouldn't have any glitch.





Mo
 
Thanks very much for your help Mo. I finally resolved the problem in this way. I made a copy of the report and updated the "Datasource Location" for this new report with the new stored proc.

Thanks again.
-Manish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top