?
Solved

Visual C++ export function fails to create PDF

Posted on 2003-11-17
8
Medium Priority
?
603 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 101

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 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 101

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

743 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