Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9072433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:09:58+00:00 2026-06-16T18:09:58+00:00

I am trying to export a Crystal Report to PDF. Here’s the code (obviously

  • 0

I am trying to export a Crystal Report to PDF. Here’s the code (obviously passwords and server names and stuff have been changed to protect the innocent)…

public void RunReport(string outputFile, int cc, int yr, int wk)
{     
    ReportDocument rd = new ReportDocument();     
    rd.Load(FullFilePath("myreport.rpt"));     
    rd.Refresh();     
    rd.SetDatabaseLogon("userid", "password");     
    foreach (Table tbl in rd.Database.Tables)    
    {          
        tbl.LogOnInfo.ConnectionInfo.ServerName = "dbname";          
        tbl.LogOnInfo.ConnectionInfo.DatabaseName = "";          
        tbl.LogOnInfo.ConnectionInfo.UserID = "userid";          
        tbl.LogOnInfo.ConnectionInfo.Password = "password";     
    }     
    foreach (IConnectionInfo ci in rd.DataSourceConnections)     
    {          
        ci.SetLogon("userid", "password");     
    }     
    DiskFileDestinationOptions diskFileDestinationOptions = new DiskFileDestinationOptions();     
    ExportOptions exportOptions;     
    PdfRtfWordFormatOptions pdfFormatOptions = new PdfRtfWordFormatOptions();     
    diskFileDestinationOptions.DiskFileName = outputFile;     
    crExportOptions = rd.ExportOptions;     
    {          
        crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;          
        crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;          
        crExportOptions.DestinationOptions = diskFileDestinationOptions;          
        crExportOptions.FormatOptions = pdfFormatOptions;     
    }     

    SetCurrentValuesForParameterField(rd, "IP_COMP_CODE", cc);     
    SetCurrentValuesForParameterField(rd, "IP_YEAR", yr);     
    SetCurrentValuesForParameterField(rd, "IP_WEEK", wk);          

    rd.Export();
}

private void SetCurrentValuesForParameterField(ReportDocument reportDocument, string paramFieldName, int value)
{ 
    ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue(); 
    parameterDiscreteValue.Value = value.ToString();
    ParameterValues currentParameterValues = new ParameterValues(); 
    currentParameterValues.Add(parameterDiscreteValue);
    reportDocument.DataDefinition.ParameterFields[paramFieldName].ApplyCurrentValues(currentParameterValues);
}

Now the weird part is, when I first wrote this code (and it was in SVN), it would give me a COM exception saying it was out of memory the first time I did an export (this was in an ASP.NET MVC app), but all subsequent exports (until I restarted the web app) would work just fine.

The error produced was:

First-chance exception at 0x75a2c41f in w3wp.exe: Microsoft C++ exception: _com_error at memory location 0x20dee4b0.

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll

An exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll but was not handled in user code

Additional information: Memory full.

Failed to export the report.    

I posted on SAP’s web site and their support guy offered some code changes which I included and then it stopped working entirely with the following error:

An exception of type 'CrystalDecisions.CrystalReports.Engine.DataSourceException' occurred in CrystalDecisions.ReportAppServer.DataSetConversion.dll but was not handled in user code

Additional information: Failed to load database information.
Error in File myreport {6DC42165-A38A-4CB2-85FD-A77389827FA9}.rpt:

Failed to load database information.    

When I reverted the code changes back, it continued to give me this error (and has since). Now I can’t export a report at all.

The changes he suggested resulted in this code:

ReportDocument rd = new ReportDocument();     
rd.Load(FullFilePath("myreport.rpt"));     
ConnectionInfo connectInfo = new ConnectionInfo()     
{          
    ServerName = "dbname",          
    DatabaseName = "",          
    UserID = "userid",          
    Password = "password"     
};     
rd.SetDatabaseLogon("userid", "password");     

foreach (Table tbl in rd.Database.Tables)     
{          
    tbl.LogOnInfo.ConnectionInfo = connectInfo;          
    tbl.ApplyLogOnInfo(tbl.LogOnInfo);     
}   

Now SAP is saying they won’t support me because I’m using VS.NET 2012, even though I’m not using any VS.NET integration, simply the SDK. They’ve been spectacularly unhelpful.

I’m running on Windows 7 64-bit. The Crystal Reports SDK I’ve installed is: CRforVS_redist_install_64bit_13_0_4.zip, available from their web site.

The database on the back end is Oracle and the client is 11g.

I’ve uninstalled and reinstalled both the Oracle client and Crystal Reports and have had no success. I simply cannot export a report any longer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:09:59+00:00Added an answer on June 16, 2026 at 6:09 pm

    I ended up having to do everything as 32-bit. I never could get the 64-bit crystal stuff working. Because of the terrible (rude) tech support, we’re going to dump Crystal for SSRS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to export a crystal report document to PDF and i am
I am trying to figure out how to export a crystal report into a
I have been trying to export the charts from Excel as an image file
Hi I am trying to export a report as CSV format from Crystal Reports
I have been trying to export some datagrids in Silverlight to excel, but have
I have been trying to export a Word document into Response using ASP.Net. So
I am trying to export my repeater to excel and here is my code...
I'm trying to export a Crystal Report to a text file, while preserving any
I'm trying to export a Crystal Report to an HTML file, but when I
I am trying to export a report but everytime it runs the code to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.