11 Replies Latest reply: Sep 17, 2012 5:15 PM by Ludek Uher RSS

Dot Net C# - Crystal Report Memory Crash issue

Sudesh Mehta
Currently Being Moderated

We are using crystal report for last 10 years. 10 years back we had written VB6 COM OCX, which was loading report at run time depending on filter criteria.

We never had memory crash issue, but using 2011 and DOT NET Dlls we wrote same component in C# and same report which works properly with 10 years old COM dlls is not working with 2011 dot net dlls.

  • Re: Dot Net C# - Crystal Report Memory Crash issue
    Jason Lax
    Currently Being Moderated

    SCN Support is for SAP Community Network support related queries only.

     

    To get a quick (or any) response, create your new discussion in a space related to your query.  This way it will be visible to topic experts who will then see and reply to it.  The SCN Site Index contains a full listing of all SCN spaces

     

    I'm now moving this thread to SAP Crystal Reports (But perhaps .NET SDK Application Development would be a better match for this query?)

    • Re: Dot Net C# - Crystal Report Memory Crash issue
      Bhushan Hyalij
      Currently Being Moderated

      Hi Sudesh,

       

      There is no .NET SDK for CR 2011. It does not install any SDK assemblies.

       

      You would need to use either

      VS 2008 / VS 2005 + CR 2008

      or

      VS 2010 + CR for VS 2010

       

      CR 2011 designer could be used to design the reports but the application should use the references of the appropriate version of CR only.

       

      For more information on the CR and VS compatibility and CR 2011 .NET SDK issue take a look at below articles.

      http://www.sdn.sap.com/?blog=/pub/wlg/25302

      http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=56787567

      http://scn.sap.com/docs/DOC-7824

       

      For more information use the search box at the top right corner of the page.

       

      hope this helps,

      Bhushan.

      • Re: Dot Net C# - Crystal Report Memory Crash issue
        Sudesh Mehta
        Currently Being Moderated

        Dear Bhushan,

         

        Thanks for reply.

         

        We tried everything. We have even registered support case of 300 CHF with SAP, but till now no success.

         

        In our C# (VS 2010) project we are using refrences:

        CrystalDecisions.CrystalReports.Design = 13.0.2000.0

        CrystalDecisions.CrystalReports.Engine = 13.0.2000.0

        CrystalDecisions.ReportSource = 13.0.2000.0

        CrystalDecisions.Shared = 13.0.2000.0

        CrystalDecisions.Windows.Forms = 13.0.2000.0

         

        Code is very simple:

         

         

        private void LoadReport()

                {

                    try

                    {

                        this.Cursor = Cursors.WaitCursor;

                        string strRpt = null;

                        ReportDocument rpt = new ReportDocument();

                        rpt.Load(txtFolderPath.Text);

                        string query;

                        if (rbBigImgs.Checked)

                        {

                            query = "SELECT * FROM crNormalImages";

                        }

                        else

                        {

                            query = "SELECT * FROM crThumbnailImages";

                        }

                        DataSet ds = GetDataSet(query);

                        rpt.SetDataSource(ds.Tables[0]);

                        crystalReportViewer1.ReportSource = rpt;

                         crystalReportViewer1.Show();

                    }

                    catch (Exception exp)

                    {

                        MessageBox.Show("Error: " + exp.Message);

                    }

                    finally {this.Cursor =Cursors.Default; }

                }

         

        Above code loads the report with images. Report is very simple, Report loads 2 images per page and total pages are less than 150. Each picture size is between 500 KB to 1.5 MB.

         

        Out of memory problem occurs when we choose PRINT button from report viewer and we choose ADOBE PDF printer ( High Quality).

         

        Loading report in viewer has no problems, but printing report from crystal report viewer  with so many images is problem.

         

        In past we were using VB6 code with COM dlls of Crystal reports and that exe still works for the same report. When we migrate solution from VB6 to C# with dot net dlls of crystal report we have "out of memory" problem while printing report.

         

        I dont know how to attach PDF file over here. Is it possible that we exchange our email ids and I give you my PDF or PPT which will explain the problem in more detail with pictures.

         

        Thanks & Regards,

        Sudesh Mehta

        • Re: Dot Net C# - Crystal Report Memory Crash issue
          Bhushan Hyalij
          Currently Being Moderated

          Hi Sudesh,

           

          Could you post the exact error / exception that the app is throwing?

          Is this happening on your dev machine or a client machine?

          If its DEV, you dont need the runtimes, uninstall the runtimes and install the actual CR for VS 2010 package (SP4 full build). Runtimes are for deployment.

           

          Also, try printing rpeort from the bundled CR designer, see how it behaves.

          Try a sample app for datasets. (data connectivity)

          http://www.sdn.sap.com/irj/boc/samples?rid=/library/uuid/5050d3d0-19dd-2d10-ffb2-ddcd30a3e655

           

          - Bhushan

          Follow us on Twitter

          Got Enhancement ideas? Try the SAP Idea Place

          Share Your Knowledge in SCN Topic Spaces

          • Re: Dot Net C# - Crystal Report Memory Crash issue
            Sudesh Mehta
            Currently Being Moderated

            Hello Bhushan,

             

            Could you post the exact error / exception that the app is throwing?

             

            Yes. Check below pictures. We get below errors on DEV as well as CLIENTmachine. Its not that always you get same error message. But we get "Out of memory"  or "The request could not be submitted for background processing".

            Picture1.png

            Picture2.png

             

            Please note : Problem is not loading report in viewer, problem is while PRINITING REPORT AS PDF FILE.

             

            Other feedback from your mail I will check and try with my developers and I will give you feedback later.

             

            Thanks & Regards,

            Sudesh

            • Re: Dot Net C# - Crystal Report Memory Crash issue
              Bhushan Hyalij
              Currently Being Moderated

              Ok,

               

              1. Clear the %TEMP% folder, which contains the Crystal temp files.

              2. Add ReportDocument.Close () and ReportDocument.Dispose() methods to your code. This cleanup code will free your memory used by the report object and will auto delete the temp files.

              3. See below document and try the suggestions.

              http://scn.sap.com/docs/DOC-21980

               

              This is an issue due to the large size / no of images in your report.

              Just as a test, See if you could add the images as OLE or Picture object instead of a blob field and see how does the app behave.

               

               

              - Bhushan

              Follow us on Twitter

              Got Enhancement ideas? Try the SAP Idea Place

              Share Your Knowledge in SCN Topic Spaces

            • Re: Dot Net C# - Crystal Report Memory Crash issue
              Ludek Uher
              Currently Being Moderated

              Crystal Reports is limited in how it works with images - large images or a large number of images, etc. Much as CR is not a good database archiving tool, it's not a very good graphics presenter. Too many graphics, large graphics, high quality graphics, all of these may cause memory issue. A few tips:

               

              1. Make sure the picture  blob  what ever, never spills beyond the designer pane of the report.
              2. Limit the number of images
              3. Lower the resolution of the images
              4. See if a computer with more memory helps
              5. See if you get the same issue with a printer other than ADOBE PDF printer
              6. If you need actual PDF, do an export to PDF

               

              You mention you have case opened with SP support. What is the number of this case?

               

              But in all of this, keep in mind my initial statement in this post:

               

              Crystal Reports is limited in how it works with images...

               

               

               

              - Ludek

              Follow us on Twitter

              Got Enhancement ideas? Try the SAP Idea Place

              Share Your Knowledge in SCN Topic Spaces

              • Re: Dot Net C# - Crystal Report Memory Crash issue
                Sudesh Mehta
                Currently Being Moderated

                Hello Ludek,

                 

                Our single case Purchase number is:

                 

                Message Number: 2520740

                 

                Your Tips.

                • Make sure the picture  blob  what ever, never spills beyond the designer pane of the report.

                Ans: We checked, it doesn't spill.

                 

                • Limit the number of images

                Ans: Not possible. It depends on customer Real estate data.

                 

                • Lower the resolution of the images

                Ans: Not possible, customer requires high quality report.

                 

                • See if a computer with more memory helps

                Ans: Machine has 4 GB RAM with quad core processor.

                 

                • See if you get the same issue with a printer other than ADOBE PDF printer

                Ans: Yes. We cannot print report even on physical printer.

                 

                • If you need actual PDF, do an export to PDF

                Ans: Customer expects high quality report.

                 

                Thanks & Regards,

                Sudesh

                 

                Message was edited by: Ludek Uher removed keycode - never share your keycode...

              • Re: Dot Net C# - Crystal Report Memory Crash issue
                Sudesh Mehta
                Currently Being Moderated

                Hello Ludek,

                 

                Below is the screenshot of VB6 workspace with crystal report 9 references:

                VB6_References.jpg

                 

                We could print the same report by connecting to same database using Crystal report 9.0.

                 

                Does it mean that Crystal report 9 COM components manages memory properly while printing report whereas Crystal report 2011 .Net components fails to perform the same task.?

                 

                We think SAP need to fix the memory crash problem of  Crystal Reports 2011.

                 

                Thanks & Regards

                 

                Sudesh

                • Re: Dot Net C# - Crystal Report Memory Crash issue
                  Ludek Uher
                  Currently Being Moderated

                  Hello Sudesh

                   

                  I notice that the case you reference (2520740) is in the CR Design queue.

                  CR using .NET does things differently...

                   

                  Unfortunately, the suggestions I made in my previous post stand. There are no other options. Issues with many graphics causing problems in Crystal Reports have been escalated a number of times to R&D and always rejected.

                   

                   

                  - Ludek

          • Re: Dot Net C# - Crystal Report Memory Crash issue
            Sudesh Mehta
            Currently Being Moderated

            Hello Bhushan,

             

            We did :

             

            If its DEV, you dont need the runtimes, uninstall the runtimes and install the actual CR for VS 2010 package (SP4 full build). Runtimes are for deployment.

             

            As per your suggestion we uninstalled all the runtimes from developer machine and installed only CR for VS 2010 package ( SP4 full build).

             

            We get below messages when we use logger feature of Crystal report (crlogger.dll)

            Crystal Report Logger files.png

             

            We will try your other suggestions and will reply soon.

             

            Thanks & Regards,

            Sudesh