Crystal Report 2013 memory problem

Hi,
I am developing a Windows service. The service calls Crystal Report to generate PDFs. When a new contract appears in database (MS Access), the service reads contract number and build a formular. Then pass the formular to ReportDocument. The code looks like this
using (ReportDocument report = new ReportDocument()) {
  report.Load("contract.rpt");
  // some initialize report
  foreach (var contract in contracts) {
    report.RecordSelectionFormula = BuildFormular(contract);
    report.ExportToDisk(ExportFormatType.PortableDocFormat, BuildOutputFilename(contract));
  report.Close();
It works fine. When deploy on production, I want the location of Access file can be changed programmatically. So I modified the code
using (ReportDocument report = new ReportDocument()) {
  report.Load("contract.rpt");
  // some initialize report
  foreach (ReportDocument subreport in report.Subreports) {
     foreach (Table table in subreport.Database.Tables) {
       table.Location = MdbPath;
  foreach (Table table in report.Database.Tables) {
    table.Location = MdbPath;
  foreach (var contract in contracts) {
    report.RecordSelectionFormula = BuildFormular(contract);
    report.VerifyDatabase();
    report.ExportToDisk(ExportFormatType.PortableDocFormat, BuildOutputFilename(contract));
  report.Close();
It works but memory increases over time. Here are Private Bytes (I use Performance Monitor tool)
10:45 - 58.000MB
11:00 - 61.801MB
11:15 - 64.611MB
11:30 - 65.544MB
11:45 - 65.716MB
12:30 - 69.095MB
I also attached some screenshot of report of DebugDiag tool.
My environment:
Net framework 4.5
Tool runs as Windows Service
Crystal Report 2013 (Crystal Report Runtime 32bit 13.0.10.1385).
Database: MS Access/OleDb
Any suggestion?
Many thanks

Hi Ludek,
I wrote 3 tests. You can get detail here:
https://dl.dropboxusercontent.com/u/4059883/WinFormSavedData.zip
https://dl.dropboxusercontent.com/u/4059883/WinFormSavedData.Statistic.docx
https://dl.dropboxusercontent.com/u/4059883/WinFormNoSavedData.zip
https://dl.dropboxusercontent.com/u/4059883/WinFormNoSavedData.Statistic.docx
https://dl.dropboxusercontent.com/u/4059883/WinFormChangeLocation.zip
https://dl.dropboxusercontent.com/u/4059883/WinFormChangeLocation.Statistic.docx
Here are summary:
Tests are a Windows Form apps with one main form which has one button. If we click on the button, it call Crystal Report to generate 100 pdf. The Access database is simple - one table which has 10 records.
Test case 1 - Saved data report.
I clicked 7 times (700 pdf created). Memory increase from 40.177 MB to 43.347 MB
Test case 2 - No saved data report
I clicked 10 times (1000 pdf created). Memory increase from 41.123MB to 42.835MB
Test case 3 - No saved data report and change location
I clicked 10 times (1000 pdf created). Memory increase from 52.412 to 54.063MB
Because I am developing a Windows Service and it runs 24/7, I expected that memory should not increase over time. My service runs 2 or 3 days and Crystal Report throws exception "Not enough memory for operation"
00:00:11,276 [Worker-8] ERROR e.PdfGenerator.PdfGeneratorJob - Error while generating pdf
CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException:
Not enough memory for operation.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   --- End of inner exception stack trace ---
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod)
Thank for all advice
Vi

Similar Messages

  • Cannot load report from server in Crystal Reports 2013 Viewer

    Hello,
    I am having trouble opening a report that is hosted on a Crystal Reports Server (2013) from the Crystal Viewer.  I've created and uploaded the reports using the report designer (version 2013).  The reports have been uploaded using the "Save As -> Enterprise" to save to my enterprise server.  This part works fine.  I then navigated to the Crystal Reports Viewer to open my report (that I just uploaded w/ the designer) from the server.  Depending on the report, one of two things happens:
    1.) I get a loading bar at the bottom right of the screen that says "Operation in progress . . ." followed by an error message:
    Unable to Refresh Report
    A problem occurred while refreshing on the server. The report may not be configured properly for refresh.
    Please contact your server administrator. (me)
    2.) I get a loading bar at the bottom right of the screen that says "Refreshing <file name of the report> (<server name>)" followed by... nothing.  The loading bar goes away and nothing happens.  It goes back to the screen that shows when the application first loads (blank canvas).
    I've taken some basic troubleshooting steps to try and rule out any potential issues that came to mind, but I've not been successful.
    Any help would be appreciated, thanks!

    Hi
    Check the below thread
    Crystal Reports 2013 data didn't refresh using OLE DB Provider for SQL Server
    With Regards
    Balaji Sampath

  • Crystal Reports 2013 OLAP connection server types

    I wrote a Crystal Reports 2013 report using the OLAP Cube Report Wizard.  In the wizard, it prompted for OLAP data and Select Cube was chosen.  In the OLAP connection browser window, Add was chosen.  In Server type, Microsoft OLE DB Provider for Analysis Services 10.0 was chosen.  The report was then finished and worked fine.  However, on a different PC, that Server type is not found if trying to re-create.  Can anyone tell me what client tools must be installed on a PC for the Microsoft OLE DB Provider for Analysis Services 10.0 to show in the Server type of an OLAP connection.  We tried installing just the OLE DB provider and now it shows under OLE DB connections but not under the OLAP Connections.
    As an added question, does anyone know what must be installed on the Business Objects 4.0 server in order to publish the same report using an OLAP connection to Bus Objects?  We have tried creating an OLAP Connection that works fine but the report does not seem to be using that type connection.  I'm guessing it needs the client tool that will answer the first question.

    Hi Nate
    I'm a little unsure of where this is not working - WIN 7? MS 2003 Server?
    What's the font problem you saw?
    What database are you connecting to?
    Is the ProvideX" ODBC driver supported on WIN 7 / WIN 2003?
    Can you connect to the database via ODBC using any other software? I's like you to try SQLConn, see what that tells you.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow me on Twitter

  • Redistributable components of crystal report 11 and Crystal Report 2013

    Currently we are facing a peculiar problem where we are having a report with 5 tables and connected using the default crystal report db connectivity.
    The report was created in a very old version of crystal report 8.5 and we have been migrating the same to latest versions.
    When i execute the report from my Application using crystal report 11 run-time components installed it works perfectly (5 Secs). In this we were using the viewer ole control embedded in our application.
    But when the same report is opened up from the application using the crystal report 2013 run-time components there is performance lag of 15 Secs every time using the viewer as separate control using C# .net framework 4.0. 
    Also Installing crystal report 11 run-time and then installing crystal report 2013 run-time resolves the issue.
    Can someone let me know if we are missing something.
    Thanks & Regards,
    Satish VS

    Hi Bhushan
    Thanks for your prompt reply
    - The old application was it a .NET or COM SDK app?
    Old application uses the COM SDK App ( CrystalRuntime.Application) developed in VB & consumed the same as an Ole object in Power builder.
    - What version of VS are you using? (Earlier and now).
    Earlier With Crystal report 11 we were directly deploying the viewer as ole control in our Powerbuilder application
    Now we are using VS2010 with .net framework 4.0 as separate viewer control
    - Is this a windows or a web application?
    Its an windows application
    - Provide the version no of CR 11 you used earlier?
    Old Application uses crystal report 11.0.0.1282
    - There are no runtimes for crystal report 2013, so could you please provide the version no for the crystal report 2013 runtimes you are using? You could check the file version of crystaldesicions.crystalreport.engine assembly.
    Yes we are using crystaldecision run-time  and the version is 13.0.2000.0 & Runtime version - v2.0.50727
    - As runtimes, did you use MSM, MSi or ClickOnce CR runtimes do deploy your application?
    We were using this CRRuntime_32bit_13_0.msi as a pre-requisite before deploying our application.
    -Also, if you could elaborate on how did you upgrade / migrate the application and deployed it, would be helpful.
    In my old application we would be using the default crystal report 11 merge module to be deployed alongwith our application msi.
    To upgrade they would install the CRRuntime_32bit_13_0.msi  and then deploy our application msi.
    Please let me know if you need any further information.
    Thanks in advance.
    Regards,
    Satish VS

  • Upgrade from Crystal report 8 to Crystal report 2013

    Dear all,
    Need some information pertaining to upgrade of Crystal report 8 to Crystal report 2013 (to be invoked from thick client .NET applications)
    Is it possible to directly upgrade from 8 to 2013 ? Or should there be a move to intermediate version before going to 2013 ?
    How is the upgrade generally done ? (do we just open the report and save in new version, or do they have any upgrade wizard)
    What are the typical issues we may face while going from lower version to higher version (I understand queries may break, format and layout may change.  Are there any other issues specific to upgradation.
    Regards,
    Jain

    Hi Jain,
    Moved your post to .NET Forums.
    Since CR 8.0 is 12 or more years old there is no "upgrade path" now. The Database drivers have all changed and the Parameter API's have also.
    Best way is to get CR 2011 and manually open each and every report and update the DB connection using the Set Table Location, this requires updating the DB Client to current versions also.
    Note there are some old legacy DB sources no longer available so that can be a problem also.
    CR 8 is not Side By Side compatible with any other version so make sure it's not installed on the same PC. It will never work and cause all sorts of problems for you.
    Basic report layout stayed the same but Printing has changed a lot also so search here, lots of post on the subject.
    For more help need to know your data source also?
    And check the Overview Tab, on the left side, lots of resources and samples to get you started.
    Also, first warning is set your project to X86 and the full Framework, do not use the Client version.
    And the SDK is no longer shipped with CR Designer install, VS installer and redist packages are all available from here:
    SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads
    Don

  • SAP tab in Crystal Reports 2013 issue

    We are using SAP Crystal Reports 2013 SP3 to build reports on BEX queries (BW 7.2). Creating a report via 'File' --> New connection --> BW MDX driver works fine, I can select bex queries & cubes and see the data. However SAP provided tab 'SAP' does not work as expected. When adding a new bex query using SAP--> Create new report from a query, I can see the list of queries and select one but it does not open and throws the following error -
    "An error occurred while generating a new report templete.
    No error"
    Using the "File" option any change to the .rpt file forces BO admin to update "DB logon" information in CMC (currently i cannot save .rpt file directly on enterprise from Crystal client due to some issue)  and we want to avoid this kind of maintainence using SAP authentication provided by using SAP tab, also the Crysal report prompts when run from BI launch pad request for prompt values twice (once for the report and once to pull list of values for each prompt) which can be avoided using SAP tab. I thought access to dev BW server is fine since the "File" tab works fine. Our BASIS team confirmed BOBJ dev servers have access to BW gateway. Am I missing something here, please help me with your experience and ideas to troubleshoot this as the only solution i could google was from a 2012 SAP recommended article to fix reginfo configuration files on SAP server
    I reinstalled Crystal Reports client twice to make sure intallation was not the issue.
    Thanks
    GORO.

    Hi Abhilash,
    Thanks for your response.
    Yes reports are working in CR 2013 designer.
    Getting Alignment and long spaces between the paragraphs issues even though report has properly designed on designer.
    After exporting to pdf getting above errors...
    -Srinivas

  • Unable to create a crystal report 2013 on the top of SAP BW 7.00

    Hello Team,
    We are trying to connect SAP Crystal Reports 2013 to SAP BW 7.00 SP26. This crystal report is being developed on the top of a BEx query accessing through OLAP.
    1.  We are getting an error- 'Internal Error: The reports applicatiton server failed'.
    2. Also, when we try to upload the same report from CMC, we get an error."...................Failed to read data from the report. Reason: Unable to open the OLAP Cube......."
    Please advise.
    Thanks.

    BI Platform
    -Abhilash

  • Where is the Manage Object function in Crystal Reports 2013 for the CMC?

    I recently upgraded to Crystal Reports 2013 after upgrading our Crystal Reports server to SAP Business Objects Platform 4.1. Before the upgrade, I could publish reports from Crystal Reports XI to the CMC then right-click on the report title in the Repository Explorer (in Crystal Reports) and I had the option to select Manage Object where I could set the default settings for the CMC. I am not seeing this option in the new version of Crystal Reports. Is there something I need to do to see this option or has this option been removed from Crystal Reports 2013?

    Hi Kelley,
    You're right, the option doesn't exist in CR XI R2 and above.
    All the options now need to be set in CMC.
    -Abhilash

  • Regarding Crystal Reports 2013 SP1/SP3 runtime distribution clafrifications

    Hi,
    We are in process of migrating exsisting Crystal Reports from CR 2008 SP4 to CR 2013 SP1/SP3.
    Iam unable to find the corresponding msms for the same for runtime distribution (to install on end user Boxs).
    Can see latest as v.13.0.13.1597 (_http://scn.sap.com/docs/DOC-7824)
    Please help out link where I can download msi (or msms) for Crystal Reports 2013 SP1/SP3 runtimes that need to be deployed on user PCs.
    Also need advise
    ( i ) Can we install both runtimes (CR 2008 SP4 and CR 2013 SP1) on user PC at same time? 
    ( ii ) We have already deployed CR 2008 SP4 runtimes on user PCs, is that sufficient? or do we need to install any other runtime?
    ( iii ) Will CR 2013 SP1 support old CR 2008 SP4 ?
    Thanks & Regards,
    Rajeshwar Rao

    Crystal 2013 does not come with the SDK, instead you have to download Crystal for Visual Studio  AND update your code to use it.  You can't just install one of the .msi  files or the .msm file (which are all available at the link you show above) and expect it to work with existing code.
    -Dell

  • SAP NetWeaver Portal Crystal Reports PDF Export Problem

    Hallo all,
    We are working with BO Edge XI 3.1 with integration on SAP Netweaver Portal. The problem is that integrated in SAP Portal CR reports cannot be exported to PDF or printed out.
    I am using an URL iview with the parameter sOutputFormat=P to run the report.
    When I want to print out the report I get the warning message from Internet Explorer "The download of files from this page is for security reasons blocked. Click here..." --> Download the file. By clicking on the u201CDownload this fileu201D the report starts to run again. PDF export doesnu2019t happen.
    Did somebody have the same problem?
    Thanks a lot in advance!

    Hello Ingo,
    thanks a lot for Your help. I have already talked to my IT department and they are looking for the solution of this problem, too.
    Is there a documentation  about necessary settings in the browser to work with SAP NetWeaver Portal and Crystal reports?
    The problem is that on some clients the PDF export is working and on another clients not. The settings of IE seem to be equal.
    Regards,
    Katharina

  • Crystal Reports PDF Export problem

    Hi I'm using Crystal 8.5 for my reports in VB 6.0. We have intrepret as RTF in the report. Now when we export this report to PDF the nested bullets loose formatting. All bullets show up at the same level. Any idea how to fix this?
    Thanks
    Sudha

    Hello Ingo,
    thanks a lot for Your help. I have already talked to my IT department and they are looking for the solution of this problem, too.
    Is there a documentation  about necessary settings in the browser to work with SAP NetWeaver Portal and Crystal reports?
    The problem is that on some clients the PDF export is working and on another clients not. The settings of IE seem to be equal.
    Regards,
    Katharina

  • Crystal Reports 2013 and Windows 8.1

    Hi,
    I'm trying to install the Crystal Reports 2013 designer on my PC, where it is installed the client of SBO 9.1 PL04.
    The operating system is Win 8.1 32bit.
    The setup of Crystal stops in the requistes control phase, in relation to the operating system.
    Is the last distributed version of Crystal designer not ready for win 8.1?
    Thanks.
    Antonio

    Hi
    Check the below matrix
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/207e34ca-0eb0-3010-b29e-8cc43838ceea?QuickLink=index&…
    With Regards
    Balaji Sampath

  • Modify SQL query in Crystal Reports 2013

    Bonjour,
    Je voulais savoir s'il était possible de modifier la requête SQL dans Crystal Reports 2013, car les bases de données de notre application pour bibliothèque utilise un format de date particulier qu'il nous faut corriger directement dans la requête SQL.
    Merci pour vos informations.
    Cordialement
    Claude Marcilly
    Cannes - France
    Hello,
    I wanted to know if it was possible to modify the SQL query in Crystal Reports 2013. Databases of our application library indeed use a particular date format that we need to fix directly into the SQL query.
    Thank you for your information.
    Best regards
    Claude Marcilly
    Cannes - France

    Hi Claude,
    If you are creating reports using tables then go in Database menu and click on show SQL query, this will show the SQL generated by crystal reports.  Now go in database expert and expend your connection and double click on Add Command and past the query which was generated by Crystal and try to modify the date format and click OK.
    Now you need to redesign your reports based on Add command.
    or
    If your reports datasource is Add command you can directly go in add command and change it.
    -Sastry

  • Crystal Reports 2013 java-error "java.lang.ClassCastException: class com.crystaldecisions..." when promoting

    Hi,
    when promoting "Crystal Report 2013" report (with data connectivity BW MDX Query) from BO DEV to BO PROD with BO Promotion Mgmt (LCM), we get the following error message in LCM jobs history:
    Resolution Status=Overwritten, Dependency Status=All the required dependencies are included.,
    Commit Status=Commit attempted and failed.,
    Promotion Status=Failure : Object promoted. Update failed.
    Error: java.lang.ClassCastException: class com.crystaldecisions.sdk.occa.report.lib.ByteArray:java.net.URLClassLoader@1d634758 incompatible
    with class com.crystaldecisions.sdk.occa.report.lib.PropertyBag:java.net.URLClassLoader@1d634758
    The report itself is present on BO PROD, but the overwrite (BW DEV MDX Query-> BW PROD MDX Query) is not applied, so report connectivity still points to the BW Query on the development system :-( .
    Moreover, the overwrite itself is detected when the job is "test promoted" ("active overwrite").
    Before, we successfully were able to transport crystal reports 2013 with overwrite (the connection then pointed to BW PROD). No idea yet what suddenly changed that...
    Any ideas what causes the error and what can fix it (no posts found, no SAP note, google also no hits)?
    Best regards
    Florian Pitschi

    Update:
    After more investigation, it looks as if the BO Server "CrystalReports2013ReportApplicationServer"
    from time to time has an issue - not only when promoting, but also when viewing publications that contain Crystal Report documents or when executing them, the java class error or similar issue is thrown.
    Did sb face similar behaviour and knows what is the root cause for "CrystalReports2013ReportApplicationServer" not working probably and throwing the java-class error? - it was running fine for several months, now, the class error showed up twice in one month.
    We need to find out what is causing the issue (aleady checked tomcat and BO-logfiles...).
    Best Regards
    Florian

  • Unable to save reports to enterprise from Crystal Reports 2013 and Crystal Reports for Enterprise

    Dear Expert,
    when we tried to save report to enterprise, error happened:
    "Failed to find a Report Application Server."
    We closed BO server firewall.
    We could check report from PC by browser.
    But when we save report from CR 2013, then error happened.
    Then we install CR enterprise and save report is ok from same PC.
    We launch latest patches too.
    Anyone see this before? Please kindly help~
    Environment:
    SAP Crystal Reports 2013
    SAP Business Intelligence 4.0
    Regards,
    April.

    April, since you have CR4E, you also have BI and thus free phone support included. My suggestion would be to create a phone incident and work with an SAP engineer on the issue. Only saying because it looks like you're somewhat anxious to get this going(?).
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

Maybe you are looking for