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!

Suppressing "Export to Text" Dialog

Status
Not open for further replies.

Josh6273

Programmer
Nov 13, 2001
17
US
Is there a way to suppress the "Export to Text" dialog box using the CRPE?

I am developing on Windows 2000 using CR8.5 Developer.

Thanks!
Josh
 
I am not sure where you are. Are you using a VB front or are you compiling the reports using the Crystal menu 'compile report' feature? If using VB provide your integration method, as per faq149-237 . Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ooops. Sorry about that.

I am using Borland C++ Builder as the front and am doing this all through the Crystal Report Engine API (CRPE32.dll).

Here is a snip of my export method (I've left out unnecessary parts):
Code:
bool OutputToTxtFile(char *FullPathFileName)
{
  char   FormatDLL[MAX_PATH];
  char   DestinationDLL[MAX_PATH];
  struct PEExportOptions   PEExportOpt;
  struct UXDDiskOptions    UXDiskOpt;

  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;

  if (!PEExportTo (PrintJob, &PEExportOpt))
        {
        ReportError(PrintJob);
        ::SetCursor( AcursorOrg);
        return false;
        }

  if (!PEStartPrintJob(PrintJob, TRUE))
    {
    ReportError(PrintJob);
    ::SetCursor( AcursorOrg);
    return false;
    }
....


The dialog comes up when PEStartPrintJob is called, but it is getting set when PEExportTo is called. I imagine it's just an option in the class that I need to enable, but I can't figure out what that might be.

Many Thanks,
Josh
 
FWIW, here's what the dialog that I am trying to suppress looks like:

export-to-text.gif


My reason for suppressing the dialog is that if the user selects "Do not prompt me again" a program crash results. I have no idea why this might be occurring, but instead of fixing the problem, I'm not going to give the problem a chance to show its ugly head.
 
I don't know the REAPI or C++, but you might look at the line that says:

PEExportOpt.formatOptions = NULL;

Just a guess - but this line might provide control of that prompt. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
This is interesting...

When I choose "Do Not Prompt Me Again" on NT, it doesn't crash. On 2000, it dies. Bah.

Thanks for the information, Ken. I'll look into it and report back.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top