cancel
Showing results for 
Search instead for 
Did you mean: 

Call to rpt.ExportToDisk Is Very Slow To Return

Former Member
0 Kudos

Hi,

I've recently upgraded my Crystal Reports runtime to the latest versions as found at the below URL:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Before making this change, we were experiencing very slow performance within the API when the following method is called:

rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.CrystalReport, filename)

After updating the runtime and running a test, there is still an almost two-minute delay before this method returns. Can you tell us if there is anything we can do to attempt to speed the performance up some? We are looking to upgrade to the latest version of Crystal, but first we would like to verify any performance gains we could expect to receive through doing so.

For reference, I have also opened ticket number 1000045636 as an inquiry into the upgrade and have been testing the trial version of Crystal Reports 2016.

Thank you for any help you may be able to provide.

View Entire Topic
0 Kudos

Do not use Crystal Reports to archive your database, exporting that much data is actually quite impressive for that size of a report file.

I suggest you have a closer look at the report, that size seems quite large.

Are there embedded images in the report? Those can consume a huge amount of memory and space.

Try using RAS to do the exporting, I don't believe it will improve but something to try:

CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;

if (ExportTypeSelected == "crReportExportFormatCrystalReports")
#region RPT
{
// This works do not alter
// this gets the report name and sets the export name to be the same less the extension
string outputFileName = "";
string MyRptName = rpt.FileName.ToString();
outputFileName = MyRptName.Substring(9, rpt.FileName.Length - 9);
outputFileName = outputFileName.Substring(0, (outputFileName.Length - 4)) + "1.rpt";

try
{
if (File.Exists(outputFileName))
{
File.Delete(outputFileName);
}

CrystalDecisions.ReportAppServer.ReportDefModel.RPTExportFormatOptions RasRPTExpOpts = new RPTExportFormatOptions();

try
{
RasRPTExpOpts = rptClientDoc.get_SavedExportOptions(CrReportExportFormatEnum.crReportExportFormatCrystalReports);
}
catch (Exception ex)
{
btnSQLStatement.Text = "ERROR: " + ex.Message;
//return;
}

// Set them now:
//RasPDFExpOpts.CreateBookmarksFromGroupTree = false;
//RasPDFExpOpts.EndPageNumber = 1;
//RasPDFExpOpts.StartPageNumber = 1;

CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions exportOpts1 = new CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions();
exportOpts1.ExportFormatType = CrReportExportFormatEnum.crReportExportFormatCrystalReports;
exportOpts1.FormatOptions = RasRPTExpOpts;

// And Export
rptClientDoc.PrintOutputController.ExportEx(exportOpts1).Save(outputFileName, true);
MessageBox.Show("Export to RPT Completed. NOTE: report is *1.RPT", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

}
catch (Exception ex)
{
btnSQLStatement.Text = "ERROR: " + ex.Message;
return;
}
// This works do not alter
}

#endregion RPT

Don