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

Writing to a SQL Server database via Crystal Reports

Status
Not open for further replies.

gazza65

Programmer
Mar 19, 2003
12
GB
All

Does anybody have a method by which at the point of activating Crystal Reports to run a report that I can also write to the SQL Server database (INSERT, UPDATE etc) via a stored procedure (or another method?). I can't do this from an external script (i.e. have a script run both CR and the DB modifying script), as this activity needs to be activated from within Crystal Reports.

The reason I need to do this is that once a report returns to me some results/rows, I need to mark those rows returned so that when I run the report again the previous rows returned are not returned again.

Cheers

This is a tricky one and any ideas would be gratefully received.



 
Once you run a report based on an SP, you might execute an SP to update rows and then return the rowset for some databases. Think of it in the reverse, have the SP mark the rows, and then return those rows in one report execution.

Reports do not run upon opening unless you're using external code.

-k
 

And this is done by putting SP type code within the Show SQL Query area within Crystal Reports ? And if not there, do I have the external code route has my only solution ?
 
No, create an SP which updates rows, then does a select from those rows.

You can base a CR on a Stored Procedure. Select Options in the Data Explorere and check Stored Procedures.

-k
 
So far your help has been invaluable, therefore
to take this thread to a logical end (I hope :)) how then do you pass parameters from crystal reports to a SP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top