I need to retrieve the name of the stored procedure that a crystal report is running. Is there any way to do this in C# using the CrystalDecisions.CrystalReports.Engine.ReportDocument object?
I can't seem to find a property that will give me the stored procedure name.
Is this even possible? I've been through almost all the properties I can think of. The DataDefinition object has collections for the Formula, Parameter, Group Name, and Running Total Fields, but not one for the Database Fields.
Edit: I need to do this programatically, as I have a lot of reports. I need the option of skipping the actual running of the report and just executing the stored procedure that the report would have used. So when the report information is inserted into the database using the program, I want to be able to pull out its stored procedure and store that information separately.
To view the definition a procedure in Object ExplorerIn Object Explorer, connect to an instance of Database Engine and then expand that instance. Expand Databases, expand the database in which the procedure belongs, and then expand Programmability.
Using a Stored Procedure in Crystal Although we can't make the above query into a database view, we can incorporate it into a stored procedure that returns a result set and then feed that stored procedure into Crystal no differently than we would feed a query based on views or tables.
In SSRS RDL file you can right click in Visual studio and click view code. there you can see any VB code that may apply, any grouping , formula ect.
You're going to kick yourself. The SP's are in...
ReportDocument.Database.Tables
DataBase
then Table.Location
Table
also don't forget about SubReports...which is another collection of ReportDocuments.
You can use SQLServer Profiler to capture what stored procedure is being called when you run the crystal report.
First, you need to have the right privileges to run profiler.
Second, you need to start trace and immediately execute the report.
Third, stop the trace & scan to see the name of the stored procedure(s) the report executed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With