Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a legacy app, written in VB6, using Crystal Reports 8 (not 8.5 - just 8).

What I need to do is to figure out how, programmatically, to generate or export a PDF version of a report.

Apparently CR 8 doesn't export to PDF - that apparently is a feature that came with 8.5. Or at least it seems broken in the version I have.

So I'm trying to use PDFCreator, and trying to control it via the COM object that is visible and accessible inside of VB6.

Here's the problem... I want to do this pdf generation in the program with no user involvement. So I want to be able to tell PDFCreator where to create the file, what to call it, etc. and I want to be able to tell Crystal Reports to print the report to PDFCreator.

Unfortunately, I can't figure out the right invocation that DOESN'T cause the user to see a pop-up window asking them where to save the pdf and what to call it.

I know that the COM object for PDFCreator seems full featured, but the actual documentation and examples - at least to accomplish what I want to do - seems scarce.

Anyone else have any ideas for me?

share|improve this question
    
Maybe I posted this to the wrong list. I think I thought I was in stack overflow when I posted. –  Zeke Hansell Feb 21 '12 at 19:17
    
What do you have on the autosave settings for pdfcreator and do you have anything entered in the actions settings? what version of pdfcreator are you using? –  datatoo Feb 21 '12 at 21:16
add comment

1 Answer

I've never used pdfcreator, but after a quick look around I found reference to an option called "UseAutoSave" which defaults to 0. Presumably, in combination with some other options, you can specify the autosave directory and filename. Hopefully, this is the correct "pdfcreator" which you are asking about.

This ( http://www.excelguru.ca/content.php?186 ) page speaks about resetting default options and has code which enumerates a number of options:

.cOption("UseAutosave") = 0
        .cOption("UseAutosaveDirectory") = 1
        .cOption("AutosaveDirectory") = "\"
        .cOption("AutosaveFilename") = ""
        .cOption("AutosaveFormat") = 0
        .cOption("UseCreationdate") = vbNullString
        .cOption("UseStandardAuthor") = 0
        .cOption("PDFUseSecurity") = 0
        .cOption("PDFUserPass") = 0
        .cOption("PDFUserPassString") = vbNullString
        .cOption("PDFOwnerPass") = 1
        .cOption("PDFOwnerPassString") = vbNullString
        .cOption("PDFEncryptor") = 0
        .cOption("PDFDisallowCopy") = 1
        .cOption("PDFDisallowPrinting") = 0
        .cOption("PDFDisallowModifyContents") = 0
        .cOption("PDFDisallowModifyAnnotations") = 0
        .cOption("PrinterTempPath") = "PDFCreator\"
share|improve this answer
    
Thanks, but I have tried to set these options for autosave. It is just that after I do, when I tell the report to print itself, the dialog boxes for PDFCreator come up, completely ignoring the settings. –  Zeke Hansell Feb 28 '12 at 20:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.