VB6 应用程序将 Crystal Report 打印为 Adobe Distiller PDF - 如何设置 PDF 文件名?
我正在维护一个旧版应用程序。它是一个 VB6 应用程序,调用 Crystal Report(看起来像 Crystal 8),然后以编程方式打印到默认打印机,该打印机设置为 Acrobat Distiller (v5.0)。当它打印为 PDF 时,它会自动将生成的 PDF 放入文件夹 (c:\pdf) 中,并将其命名为水晶报表文件名的前 5 个字符。发生的情况是,文件名前面具有相同字符的两个报告被相继打印,第二个报告覆盖第一个报告。
是否有关于蒸馏器如何产生输出的设置?我可以调整输出路径或文件名吗?在哪里/为什么只使用报告文件名的前五个字符作为输出?或者这是一个 Crystal 函数?
从 Crystal 打印时是否可以定义输出 PDF 文件名?它打印报告的方式如下:
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
有什么想法吗?
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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这只是一个代码片段,整个过程还有更多内容。尝试在整个 VB6 代码中搜索
Sreport
。如果您能找到如何定义Sreport
,这可能会回答您的问题。我猜某处有一行内容是这样的:
将 5 更改为 10,然后就可以开始了。
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 howSreport
is defined, that may answer your question.I'm guessing somewhere is a line that says something like,
Change that 5 to a 10 and you're good to go.