Finding the stored procedure used by Crystal Report

I need to get the name of the stored procedure in which the crystal report runs. Is there a way to do this in C # using a CrystalDecisions.CrystalReports.Engine.ReportDocument object?

I cannot find a property that will give me the name of the stored procedure.

Is it possible? I went through almost all the properties that I can think of. The DataDefinition object has collections for the formula, parameter, group name, and total number of fields, but not for database fields.

Edit: I need to do this programmatically since I have a lot of reports. I need the opportunity to skip the actual start of the report and simply execute the stored procedure that the report would use. Therefore, when the report information is inserted into the database using the program, I want it to be able to pull out its stored procedure and save this information separately.

+5
source share
4 answers

You are going to kick yourself. SP are in ...

ReportDocument.Database.Tables

Database

then Table.Location

Table

also don't forget about SubReports ... which is another collection of ReportDocuments.

+4
source

SQLServer, , Crystal.

-, .
-, .
-, , (), .

+1
0

(, VB, ):

Private subtitle logLogOnInfo (table as table) log.DebugFormat ("LogOnInfo.ConnectionInfo for {0}:", table.Name) Dim ci As ConnectionInfo = table.LogOnInfo.ConnectionInfo log.Debug (String.Format ("AllowCustomConnection: 0 }, DBName: {1}, IntegratedSecurity: {2} ", ci.AllowCustomConnection, ci.DatabaseName, ci.IntegratedSecurity)) log.Debug (String.Format (" ServerName: {0}, User: {2}, Password : {1}, Attributes: ", ci.ServerName, ci.Password, ci.UserID))

For Each a As NameValuePair2 In ci.Attributes.Collection
    If a.Name = "QE_LogonProperties" Then
        Dim attributes As DbConnectionAttributes = a.Value
        For Each b As NameValuePair2 In attributes.Collection
            log.DebugFormat("        {0}: {1}", b.Name, b.Value)
        Next
    Else
        log.DebugFormat("    {0}: {1}", a.Name, a.Value)
    End If
Next

End Sub

0
source

All Articles