Solved

Visual C++ export function fails to create PDF

Posted on 2003-11-17
8
590 Views
Last Modified: 2012-06-22
Custom report generator written in Visual C++ 6.0 using Crystal Reports 8.5 Developer edition. Code worked fantastic for several months ... until today. Just stopped working. Now, when the generator attempts to export the report, it creates a 0 byte PDF file, and then throws an unamed exception. At first I thought it might of been because %TEMP% was FULL of binary files which I'm 99% sure came from the report generation processes. However, I still see the same problem after deleting the temp files and rebooting. Note that the EXACT SAME code works fine when I move it to a different machine. I've unistalled/re-installed Crystal, installed the service pack, rebooted serveral times ...it's very puzzling.

Code snippet:

try
{
    ... lots of code here ...

    IExportOptionsPtr options = m_Report->ExportOptions;

    options->FormatType       = crEFTPortableDocFormat;
    options->DestinationType = crEDTDiskFile;
    options->DiskFileName     = SavePath;

    if(m_Report->Export(false) != S_OK)
    {
        cleanUp  (db, debugFile, "Failed to generate report", cr_id);
        EndDialog(IDOK);
        return;
    }

    ... bit more code here

catch (CDBException *cdbe)
{      
// process error
}
catch (CMemoryException  *cme)
{      
// process error;
}
catch (CException *e)
{
// process error
}
catch (...)
{
// This is the the block the code hits at runtime
}

Any thoughts?
0
Comment
Question by:RichG
  • 3
  • 3
8 Comments
 

Author Comment

by:RichG
ID: 9771012
Further data:

I bypassed this custom code and simply tried to export a report to PDF right in the Crystal report designer. The export fails. I can however export the same report to Excel.

Is there a hard limit to how many reports a single installation of Crystal can export to PDF?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9771170
Sounds like the PDF export dll is corrupt.

When you move to another machine are you moving the code or an executable?

mlmcc
0
 

Author Comment

by:RichG
ID: 9771633
If it was a corrupted dll, wouldn't the uninstall/reinstall I described above fixed the issue?

I'm really starting to think it's a hard coded limit with the number of PDF's you can generate (Adobe licensing?) 'cause I uninstalled/reinstalled (like I did before ), but this time I went into the registry and manually deleted all registry keys associated with Seagate software ... and now it works.

Oh, and to answer your question, I didn't even really move the program (it's an exe we compile) to another machine. All I did is mount the machine via a windows network link. Once the machine was mounted, I used explorer to navigate to the machine (over the network ) the custom program runs on and clicked the icon for the executable. It works if invoked this way. If instead, I go directly to the console for the report machine, and click on the executable, the export fails as described above.

Anyway, I'm back up and running. Will have to figure out a new solution; however, as doing what I just described is pretty ugly.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 9775645
Crystal has had a bad record of failing to fully uninstall.  I thought they fixed it with CR8.5 but I use CR8 so it may not be.

Are any of the dlls installed on the "client" machine?

What OS?

How many files are in the directory?

mlmcc
0
 

Author Comment

by:RichG
ID: 9779264
Not sure what you mean by client machine. There is only one machine, a server that runs our custome exectable. On that same machine, we have Crystal 8.5 (Developer version) installed; plus Crystal service pack 2.

OS is Windows 2000 server fully updated with most recent service packs.

Files in what directory? I have a single directory on the server machine called reports. That directory contains all our rpt files, the custom executable, and a log file.

Like I said above, whatever it was (corrupt DLL, or some sort of limit to the number of PDF's that can be generated, or something else entirely) I'm all set now. Removing the registry keys appeared to work.

Thanks for the input.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9784089
I don't know of a limit but I'll keep my eyes open.  I can't think of a reason for having a limit.

mlmcc
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Reports 2008 6 35
Crystal Reports last day of month 2 60
Crystal Report sorting 6 16
Summarizing a percent by a grouped category 14 32
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question