将水晶报告导出为pdf

将水晶报告导出为pdf

问题描述:

我正在使用以下代码在vb.net项目中打开一个新的Word文档

I am using the below code to open a new word document in my vb.net Project

Dim oWord As Word.Application
       Dim oDoc As Word.Document
oWord = CreateObject("Word.Application")
           oWord.Visible = True




这段代码可以用Word打开一个新的Word文档,然后进行必要的更改然后保存.类似地,我可以在按钮中单击




This code open a new word document in word and then i make necessary changes and then save it.Similerly can i export a pdf document in th button click

VB.NET Crystal Reports导出为PDF [ iTextSharp [ ^ ]
VB.NET Crystal Reports Export to PDF[^]

EDIT

Use iTextSharp[^]


这很容易:您要做的就是获取crystalreport对象的新实例

昏暗的rpt作为新的CrystalReport1


设置必要的属性,例如数据源,SelectionFormula等.
然后按如下所示调用Export方法:

rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,"Report.pdf ")
It''s quite easy: all you have to do is get a new instance of a crystalreport object

Dim rpt as new CrystalReport1


Set the necessary properties, like datasource, SelectionFormula, etc.
Then call the Export method as follows:

rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "Report.pdf")