RE: Stored Procedure Called through Crystal Report, Doesn’t insert records

      Dear Tech Team,

      I have a RPT file that has few sub reports. The Main Stored procedure that I’m using for the crystal reports inserts few records in one of the table and that table is referenced in the sub reports. This works fine with the old version of crystal reports (Version 9) with the C++ Code. We recently migrated it to .Net Version: SP16, VS2013, MS SQL Standard 2014. It appears that when the main Stored Procedure is called, which has the insert statement to insert records in another table not at all works. We use ODBC Connection (SQL Native Client) to connect to the SQL server. Please advise.

      Thanks,

      Arun

      Hi Arum,   Ah ha... nice detective work....   they have updated the Subreport Object collection, previously you were limited to 40 subreports, now it's 120. So this change may have altered the way we read in the subbreport collection.   Once way to get them is:   //set the crSections object to the current report's sections CrystalDecisions.CrystalReports.Engine.Sections crSections = rpt.ReportDefinition.Sections; int flcnt = 0; bool SecureDB;   //loop through all the sections to find all the subreport objects foreach (CrystalDecisions.CrystalReports.Engine.Section crSection in crSections) { crReportObjects = crSection.ReportObjects; //loop through all the report objects to find all the subreports foreach…

      User Rating: Be the first one !
      Add Comment
      1 Answers

        Hi Arum,

         

        Ah ha… nice detective work….

         

        they have updated the Subreport Object collection, previously you were limited to 40 subreports, now it’s 120. So this change may have altered the way we read in the subbreport collection.

         

        Once way to get them is:

         

        //set the crSections object to the current report’s sections

        CrystalDecisions.CrystalReports.Engine.Sections crSections = rpt.ReportDefinition.Sections;

        int flcnt = 0;

        bool SecureDB;

         

        //loop through all the sections to find all the subreport objects

        foreach (CrystalDecisions.CrystalReports.Engine.Section crSection in crSections)

        {

        crReportObjects = crSection.ReportObjects;

        //loop through all the report objects to find all the subreports

        foreach (CrystalDecisions.CrystalReports.Engine.ReportObject crReportObject in crReportObjects)

        {

        if (crReportObject.Kind == ReportObjectKind.SubreportObject)

        {

        try

        {

         

        The other way is to open the subreport by name

         

        So I don’t believe we will alter the order again, DEV said 120 is max the SDK will be able to access.

        It did update the the info in the RPT file but nothing you can access either.

         

        That Parameter App in Doc-70646 has a drop down list to get subreports using above code, I believe the order that it produces is the order of insertion. As far as I recall I don’t believe this ever changed but may be different for subreport objects. You can see this in the various object labels, depends on when the object was added to the report.

         

        Don

        Add Comment

        Your Answer

        By posting your answer, you agree to the privacy policy and terms of service.