Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to Disk File problem

Status
Not open for further replies.

Breazel

Programmer
Dec 14, 2000
2
RU
To export Seagate Crystal Reports report to disk *.rpt file, I trying to use following code. What's wrong?


PEExportOptions exportOptions;
UXDDiskOptions diskOptions;

BOOL bEngineReady = PEOpenEngine ();
short iPrintJob = PEOpenPrintJob("c:\\MyReport2.rpt");
short nNumber = PEGetNParameterFields (iPrintJob);

diskOptions.structSize = UXDDiskOptionsSize;
diskOptions.fileName = "c:\\exp025.rpt";
exportOptions.StructSize = PE_SIZEOF_EXPORT_OPTIONS;
lstrcpy(exportOptions.formatDLLName, "u2fcr.dll");
exportOptions.formatType = UXFCrystalReportType;
lstrcpy(exportOptions.destinationDLLName, "u2ddisk.dll");
exportOptions.destinationType = UXDDiskType;
exportOptions.destinationOptions = &diskOptions;

if (!PEExportTo(iPrintJob, &exportOptions))
{
AfxMessageBox(PEGetErrorCode(iPrintJob));
}

// Start the job (here error has occur)
if (!PEStartPrintJob(iPrintJob,1))
{
AfxMessageBox(PEGetErrorCode(iPrintJob));
}
BOOL b2 = PEClosePrintJob(iPrintJob);
 
hello breazl,

if Peexportto did not execute successfully (returned a false value), you should proceed to executing PestartPrintJob. Try to get the returning value of PeExportTo; if it returned false, do not proceed to PEStartPrintJob. And if PeExporTo didnt successfully execute, then you have a new problem.

Rachel
 
hello breazl,

if Peexportto did not execute successfully (returned a false value), you should NOT proceed to executing PestartPrintJob. Try to get the returning value of PeExportTo; if it returned false, do NOT proceed to PEStartPrintJob. And if PeExporTo didnt successfully execute, then you have a new problem.

Rachel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top