cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Crashes : CRAXDRT.DLL fails

Former Member
0 Kudos

I am using an old version of Crystal Reports probably v8. We have our users who like to see the report in PDF format.

On certain days,when the users open the reports at high frequency the application goes crashing down.

We are using asp.net 3.5 to run this application which was developed in vb.net.

When i looked at the code,it is first saving the report on the server and then the same file is being read and displayed on the browser as a pdf.

I have some questions.

1. Can we directly render the report without having to save it on the hard-disk of the server?

2. What is the current version of crystal reports?

3. How do I prevent the CRAXDRT from crashing?

4. Crystal Reports 9 ActiveX Designer Runtime Library,is it something which we need to install on the server where crystal reports are placed?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

CR 8 did know know what 3.5 framework is, set the project to use FW 1.1 and it may work.

That version is 10 + years old so it's not aware of the current OS's or WEB servers.

Only Current SDK uses CR .NET assemblies. Upgrade your WEB app to ASP.NET and download the VS 2010/2012/2013 installer and runtime packages from here:

Licencing info is here:

There is no supported RDC version of CR available now.... Time to upgrade

Don

Former Member
0 Kudos

Hi Don,

Could you tell me if I can render the reports without having to save them on a hard-disk and then read from that location?

0 Kudos

Yes, you can use the stream API, something like this:

private void ExportToStream_Click(object sender, EventArgs e)
{
    rptClientDoc = rpt.ReportClientDocument;

    CrystalDecisions.Shared.MicrosoftMailDestinationOptions mailOpts = CrystalDecisions.Shared.ExportOptions.CreateMicrosoftMailDestinationOptions();
    CrystalDecisions.Shared.DiskFileDestinationOptions diskOpts = CrystalDecisions.Shared.ExportOptions.CreateDiskFileDestinationOptions();
    CrystalDecisions.Shared.ExportOptions exportOpts = new CrystalDecisions.Shared.ExportOptions();
    CrystalDecisions.Shared.CharacterSeparatedValuesFormatOptions csvExpOpts = new CrystalDecisions.Shared.CharacterSeparatedValuesFormatOptions();
    CrystalDecisions.Shared.HTMLFormatOptions HTMLExpOpts = new CrystalDecisions.Shared.HTMLFormatOptions();
    CrystalDecisions.Shared.PdfFormatOptions PDFExpOpts = new CrystalDecisions.Shared.PdfFormatOptions();
    CrystalDecisions.Shared.EditableRTFExportFormatOptions RTFExpOpts = new CrystalDecisions.Shared.EditableRTFExportFormatOptions();
    CrystalDecisions.Shared.PdfRtfWordFormatOptions PDFRTFExpOpts = new CrystalDecisions.Shared.PdfRtfWordFormatOptions();
    CrystalDecisions.Shared.ExcelDataOnlyFormatOptions XLSXExpOpts = new CrystalDecisions.Shared.ExcelDataOnlyFormatOptions();
    CrystalDecisions.Shared.TextFormatOptions txtFmtOpts = new CrystalDecisions.Shared.TextFormatOptions();
    CrystalDecisions.Shared.ReportFileFormat crExpFormat = new CrystalDecisions.Shared.ReportFileFormat();
    CrystalDecisions.ReportAppServer.ReportDefModel.HTMLExportFormatOptions myHTML = new HTMLExportFormatOptions();
    CrystalDecisions.ReportAppServer.ReportDefModel.RPTExportFormatOptions myRPTExp = new RPTExportFormatOptions();
    CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions RASEptOpts = new CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions();

    rpt.Load(@"c:\reports\b.rpt");

    rptClientDoc = new ReportClientDocument();

    string MyRptName = rpt.FileName.ToString();
    MyRptName = MyRptName.Substring(MyRptName.LastIndexOf(@"\") + 1, (rpt.FileName.Length - 3) - (MyRptName.LastIndexOf(@"\") + 1)) + "pdf";


    exportOpts.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
    exportOpts.ExportDestinationOptions = diskOpts;
    diskOpts.DiskFileName = @"D:\Atest\735372\ReportName.rpt";

    CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions exportOptions = new CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions();
    exportOptions.ExportFormatType = CrReportExportFormatEnum.crReportExportFormatPDF;

    //rptClientDoc.VerifyDatabase();

    //This exports the report to a byte() that we will stream out.
    Byte[] oByte = (Byte[])rptClientDoc.PrintOutputController.ExportEx(exportOptions).ByteArray;

    //this is used to verify the file so I saved it to disk
    System.IO.File.Create(diskOpts.DiskFileName, Convert.ToInt32(oByte.Length)).Close();

    System.IO.File.OpenWrite(diskOpts.DiskFileName).Write(oByte, 0, Convert.ToInt32(oByte.Length));
    System.IO.File.SetAttributes(diskOpts.DiskFileName, System.IO.FileAttributes.Directory);

    GC.Collect();
    MessageBox.Show("Export to Stream complete", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

I do export to disk but not required. There are other ways also but the idea is the same.

Don

Former Member
0 Kudos

Don,

I guess the report is first going to a D-drive :Atest folder...I meant is there a way via which i do not have to send it to d-drive and just directly display the report on the browser?

0 Kudos

Try searching, as I said there are other ways that develoeprs are streaming the output directly to the Browser. I'm sure there is code posted in here on how they did it.

Don

Answers (0)