Solved

Visual C++ export function fails to create PDF

Posted on 2003-11-17
8
589 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Report Error 14 85
Crystal Reports CSV data source, field types 6 102
Printing duplex pages and have a page break 6 44
Conditional Page Breaks Based On Grouping 1 31
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 …
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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