Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB6 app printing Crystal Report to Adobe Distiller PDF - how to set PDF filename?

I've got a legacy app that I'm maintaining. It's a VB6 app that calls a Crystal Report (Crystal 8 it looks like) and then prints programmatically to the default printer, which is set up as Acrobat Distiller (v5.0). When it prints to PDF, it's automatically placing the resulting PDF in a folder (c:\pdf) and naming it as the first 5 characters of the crystal report filename. What's happening is that two reports with the same characters at the front of the filename are getting printed one after another, and the second is overwriting the first.

  1. Are there settings somewhere for how distiller produces output? Can I adjust the output path, or the filename? Where/why is it only using the first five characters of the report filename as output? Or is that a Crystal function?

  2. Is there a way to define the output PDF filename when printing from Crystal? It is printing the report like so:

With CrPt
        .Connect = "DSN=" & Trim(sServerName) & ";UID=usernam;PWD=password;DSQ=database"
        .ReportFileName = sReport
        .Formulas(0) = "version=""" & App.Major & "." & App.Minor & "." & App.Revision & """"
        .Destination = crptToPrinter
        .Action = 1
    End With

Any ideas?

like image 387
Peter Tirrell Avatar asked Apr 09 '10 14:04

Peter Tirrell


People also ask

Where is distiller in Acrobat DC?

To start Acrobat Distiller (Windows), choose All Program > Adobe Acrobat Distiller.

What does Acrobat Distiller do?

Description: Adobe Distiller allows users to convert Postscript files into Portable Document Format (PDF) files. This technology was originally a standalone product and has more recently been combined with Adobe Acrobat products and discontinued as a standalone product.


1 Answers

I assume this is just a code snippet and there's more to the entire process. Try searching your entire VB6 code for Sreport. If you can find how Sreport is defined, that may answer your question.

I'm guessing somewhere is a line that says something like,

Sreport="C:\pdf\" & left(somevar,5)

Change that 5 to a 10 and you're good to go.

like image 125
PowerUser Avatar answered Oct 11 '22 07:10

PowerUser