hi
im new to crystal report. how can i call it in vb and is there any way to save the report to .pdf file
Printable View
hi
im new to crystal report. how can i call it in vb and is there any way to save the report to .pdf file
Moved to reporting section.
how can i call crystal report in vb
This is a snippet from a VB.Net program I wrote, but you may be able to adapt it to VB:
VB Code:
Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Dim CrystalReportDocument As ReportDocument Dim CrystalExportOptions As ExportOptions Dim CrystalDiskFileDestinationOptions As DiskFileDestinationOptions Dim Filename As String CrystalReportDocument = New ReportDocument() CrystalReportDocument.Load("Path" & "CrystalReportTemplateName.rpt") Filename = "C:\FileName.pdf" CrystalDiskFileDestinationOptions = New DiskFileDestinationOptions() CrystalDiskFileDestinationOptions.DiskFileName = Filename CrystalExportOptions = CrystalReportDocument.ExportOptions With CrystalExportOptions .DestinationOptions = CrystalDiskFileDestinationOptions '<- This is what makes it save the report on disk .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat '<- This is what makes it save it as a pdf document End With CrystalReportDocument.Export()
what version crystal reports and vb?