VB6 应用程序将 Crystal Report 打印为 Adob​​e Distiller PDF - 如何设置 PDF 文件名?

发布于 2024-08-28 15:32:26 字数 797 浏览 5 评论 0原文

我正在维护一个旧版应用程序。它是一个 VB6 应用程序,调用 Crystal Report(看起来像 Crystal 8),然后以编程方式打印到默认打印机,该打印机设置为 Acrobat Distiller (v5.0)。当它打印为 PDF 时,它会自动将生成的 PDF 放入文件夹 (c:\pdf) 中,并将其命名为水晶报表文件名的前 5 个字符。发生的情况是,文件名前面具有相同字符的两个报告被相继打印,第二个报告覆盖第一个报告。

  1. 是否有关于蒸馏器如何产生输出的设置?我可以调整输出路径或文件名吗?在哪里/为什么只使用报告文件名的前五个字符作为输出?或者这是一个 Crystal 函数?

  2. 从 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.

  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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落叶缤纷 2024-09-04 15:32:26

我认为这只是一个代码片段,整个过程还有更多内容。尝试在整个 VB6 代码中搜索 Sreport。如果您能找到如何定义 Sreport ,这可能会回答您的问题。

我猜某处有一行内容是这样的:

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

将 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 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文