VB6 app printing Crystal Report to Adobe Distiller PDF - how to set PDF filename?
I've got a legacy ap开发者_高级运维p 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.
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?
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?
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.
精彩评论