Skip to Content
0
Former Member
Oct 11, 2011 at 03:25 PM

PrintOutputController::ExportEx - The system cannot find the path specified

80 Views

I just converted our code from using an older Crystal Reports API for creating PDFs and print jobs (ExportToDisk() and PrintToPrinter()) to using the RAS methods. Now, when calling PrintOutputController::ExportEx(), occassionally the code generates an exception.

Our log file contains the following lines:

calling ExportEx()...

  • ERROR: caught Exception in CreateReport():

name: COMException

message: The system cannot find the path specified.

creating new ReportDocument

loading template: d:
dev
sources
video
nextlink
Reports
singlemeeting.rpt... done

sleeping for 5 seconds...

retrying export/print...

exporting to:
mako\export\confirmations
1138551.pdf...

entering createPDF():
mako\export\confirmations
1138551.pdf...

calling ExportEx()...

  • ERROR: caught Exception in CreateReport():

name: CrystalReportsException

message: The report filename was empty.

Here's the snippet of code that is occassionally generating the exception:

void

NReportFaxServiceImpl::createPDF(

ReportDocument^ rpt,

String^ destinationString)

...", destinationString);

CrystalDecisions::ReportAppServer::ReportDefModel::ExportOptions^ exportOpts(gcnew CrystalDecisions::ReportAppServer::ReportDefModel::ExportOptions());

// Set the ExportFormatType to PDF...

exportOpts->ExportFormatType = CrystalDecisions::ReportAppServer::ReportDefModel::CrReportExportFormatEnum::crReportExportFormatPDF;

Console::Write(" calling ExportEx()...");

// This creates the report as a ByteArray that we will write to disk.

CrystalDecisions::ReportAppServer::CommonObjectModel::ByteArray ^ byteArray = rpt->ReportClientDocument->PrintOutputController->ExportEx(exportOpts);

Console::WriteLine("done.");

cli::array<unsigned char, 1>^ oByte = byteArray->DetachArray();

// Create the File...

Console::Write(" creating the PDF file...");

System::IO::File::Create(destinationString, Convert::ToInt32(oByte->Length))->Close();

Console::Write("writing the PDF file...");

System::IO::File::OpenWrite(destinationString)->Write(oByte, 0, Convert::ToInt32(oByte->Length));

Console::Write("calling SetAttributes()...");

System::IO::File::SetAttributes(destinationString, System::IO::FileAttributes::Directory);

Console::WriteLine("done");

GC::Collect();

}

We're running Crystal Reports 2008 SP4 on a Windows 2003 server (virtual server).