Solved

Visual C++ export function fails to create PDF

Posted on 2003-11-17
8
583 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now