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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a stored procedure

Status
Not open for further replies.

aspnetuser

Technical User
Sep 9, 2004
273
US
I created a sub report in which the datasource is a stored procedure it SQL server. I need to run this first before the main report runs so it populates the temp tables that the main report reads. Does crystal evaluate this first and execute the stored procedure because it is in the report header? It seems like it works but i am not sure if the temp tables are being updated. i was looking for some clearity?
 
Crystal will always run the main report first, perhaps you want the subreport as your main report?

You should be able to use a SQL Server SP to populate a temp table or a cursor and then have that same SP return the data to the main report instead of using a subreport.

-k
 
I can't use an sp in this case to return a result. The main report points at the temp tables created. Therefore I need to invoke the SP first. I am not sure of another way to do this? Is it possible.

CR8.5
SQLSERVER 2k
 
Do it all in the SP, create the cursor/temp tables, and the last thing in the SP is to return the data.

You say you can't do this, but not why.

Subreports are generally a bad idea anyway.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top