views:

275

answers:

1

I've got a legacy piece-o'-s- 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. Soooo....

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 help? Thanks!

A: 

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.

PowerUser
CrPt is the Crystal Report object; sReport is the full path filename to the .rpt file. I did find where the output folder is set, it seems to be a function of the port on the Adobe Distiller printer device. I think the naming convention of the PDF is some sort of Distiller default...I think I can set an option to prompt for a filename but that's probably going to break other processes that rely on automation in this mess.I think I'm ending up recreating the report in SSRS and having the user run that...the combo of VB6/Crystal/Adobe is a colossal mess.
edmicman
PowerUser