locked
Retrieving Stored Procedure RRS feed

  • Question

  • User238496256 posted

    Hi Guys,

    Hope you can help me on this. I have a Crystal Report File and I want to know what's the name of the Stored Procedure that is being used on the Report. How can I retrieve it through the code behind.

    C# code would be better since I do coding in c#.

    TIA!

    Monday, July 25, 2011 3:21 AM

Answers

  • User705563967 posted

    You get the stored procedure name through coding from "oCRTables[i].Location" but you should write complete database logon information.

    CrystalDecisions.CrystalReports.Engine.Database oCRDb = rpt.Database; // rpt means your reportdocument object before using this you will set the report path and connection 
    CrystalDecisions.CrystalReports.Engine.Tables oCRTables = oCRDb.Tables; 
    CrystalDecisions.CrystalReports.Engine.Table oCRTable = default(CrystalDecisions.CrystalReports.Engine.Table);
    string = oCRTables[i].Location;
    
    

    for complete detail check this link.

     http://dotnetfarrukhabbas.blogspot.com/search/label/CrystalReport%20Connection

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 28, 2011 1:54 AM

All replies

  • User-20777992 posted

    You probably can retrieve the binding source by using the following line of code.

    CrystalReportViewer1.ReportSourceID

    Check it if it helps!!!

    Monday, July 25, 2011 6:33 AM
  • User1196771204 posted

    hi there,

    I do not think that you can retrieve the stored proc directly via the Crystal Report. I am open to other ideas!

    :-) 

    Monday, July 25, 2011 12:03 PM
  • User238496256 posted

    that was the first thing that comes to my mind... guys, any idea? is it possible?

    Monday, July 25, 2011 9:58 PM
  • User705563967 posted

    You get the stored procedure name through coding from "oCRTables[i].Location" but you should write complete database logon information.

    CrystalDecisions.CrystalReports.Engine.Database oCRDb = rpt.Database; // rpt means your reportdocument object before using this you will set the report path and connection 
    CrystalDecisions.CrystalReports.Engine.Tables oCRTables = oCRDb.Tables; 
    CrystalDecisions.CrystalReports.Engine.Table oCRTable = default(CrystalDecisions.CrystalReports.Engine.Table);
    string = oCRTables[i].Location;
    
    

    for complete detail check this link.

     http://dotnetfarrukhabbas.blogspot.com/search/label/CrystalReport%20Connection

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 28, 2011 1:54 AM
  • User238496256 posted

    Thank you Farrukh! It helps! :)

    Thursday, July 28, 2011 3:11 AM