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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

500 Error When Exporting To Text File

Status
Not open for further replies.

Josh6273

Programmer
Nov 13, 2001
17
0
0
US
Hi all -

I get a "Not enough memory for operation" when I attempt to export a print job to a text file (see below). Interestingly, the text file is created when I have no parameters that I am passing to the report (I still get the error, though), but when I enter some query criteria, the export does not take place, the file isn't created, and I only get the error. I am using Crystal 8.5 Developer on Windows 2000 SP2. My export code is below. Does anyone have any idea what might be causing this?

Thanks!
Josh

Code:
bool TDMMPrintReport::OutputToTxtFile(char *FullPathFileName)
{
  char   FormatDLL[MAX_PATH];
  char   DestinationDLL[MAX_PATH];
  struct PEExportOptions   PEExportOpt;
  struct UXDDiskOptions    UXDiskOpt;

  HCURSOR AcursorOrg = ::SetCursor( ::LoadCursor(NULL, IDC_WAIT));
  UXDiskOpt.structSize = sizeof(UXDDiskOptions);
  UXDiskOpt.fileName = FullPathFileName;

  PEExportOpt.StructSize =  PE_SIZEOF_EXPORT_OPTIONS;
  strcpy(PEExportOpt.formatDLLName, "u2ftext.dll");
  PEExportOpt.formatType = UXFTextType;
  PEExportOpt.formatOptions = NULL;
  strcpy(PEExportOpt.destinationDLLName, "u2ddisk.dll");
  PEExportOpt.destinationType = UXDDiskType;
  PEExportOpt.destinationOptions = &UXDiskOpt;

  SetDatabasesLocation ();

//THIS GOES THROUGH IN ALL CASES
  if (!PEExportTo (PrintJob, &PEExportOpt))
        {
        ReportError(PrintJob);
        ::SetCursor( AcursorOrg);
        return false;
        }

//THE START OF THE PRINT JOB ALWAYS FAILS
  if (!PEStartPrintJob(PrintJob, TRUE))
    {
    ReportError(PrintJob);
    ::SetCursor( AcursorOrg);
    return false;
    }
 
Hi Josh,
I am trying the exact same thing that you are.. Try to export a crystal Report without the intermediate Export dialogs. Let me clarify a few doubts
I am exporting my report to WORD and I get the following error
For the lines
ExpOpt.formatType = UXFTextType; and
ExpOpt.destinationType = UXDDiskType;
I get an error which says that UXFTextType and UXDDiskType are undefined.

How do I export this report to pdf

With regards,
Sitaram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top