如何在 Crystal Report 中导出为 PDF 文件? [英] How to Export to a PDF file in Crystal Report?

查看:22
本文介绍了如何在 Crystal Report 中导出为 PDF 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 VB 6 和 Crystal Report 8.5

Using VB 6 and Crystal Report 8.5

在客户端系统生成报告时,我点击了报告中的导出为PDF按钮;它显示导出,导出选项.选择导出文件未显示在客户端系统中.

In client system while generating the report, I clicked export to PDF button in the report; it displayed Export, Export Option. Choose Export file is not displaying in the client system.

但在我的系统中,它显示它显示导出,导出选项.选择导出文件.但是在客户端系统中没有显示选择导出文件屏幕.

But in my system, it was displayed it displayed Export, Export Option. Choose Export file. But in client system is not showing the choose export file screen.

我无法以 pdf 格式保存报告文件.因为它没有要求保存文件名.

I cannot able to save a report file in pdf. Because it was not asking a file name to save.

谁能帮忙解决这个问题?

Can any one help to solve this problem?

推荐答案

试试,

Private Sub ExportReportToPDF(ReportObject As CRAXDRT.Report, Byval FileName As String, Byval ReportTitle As String)
   Dim objExportOptions As CRAXDRT.ExportOptions
   ReportObject.ReportTitle = ReportTitle
    With ReportObject
        .EnableParameterPrompting = False
        .MorePrintEngineErrorMessages = True
    End With

   Set objExportOptions = ReportObject.ExportOptions
    With objExportOptions
        .DestinationType = crEDTDiskFile
        .DiskFileName = FileName
        .FormatType = crEFTPortableDocFormat
        .PDFExportAllPages = True
    End With

    ReportObject.Export False 

End Sub  

Private Sub Command1_Click()
        Dim objCrystal As CRAXDRT.Application
        Dim objReport As CRAXDRT.Report

        Set objCrystal = New CRAXDRT.Application
        Set objReport = objCrystal.OpenReport(ReportFileName, 1)  

        ExportReportToPDF objReport, "c:foofoo.pdf", "foo" 
End Sub 

这篇关于如何在 Crystal Report 中导出为 PDF 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆