Page 1 of 1

Report Generating PDF file in Plugs-in

PostPosted: Wed May 20, 2015 5:53 pm
by OliverYan
Hi,
I'm upgrading a plugs-in from Jiwa6 to Jiwa 7. a plugs is able to generate PDF file by opening an existed report file, but I found the component and properties are changed in Jiwa 7. I have no enough document for this.
Would you please tell me how to generate PDF file from an existed report ?

Thank you very much.
Oliver

Re: Report Generating PDF file in Plugs-in  Topic is solved

PostPosted: Thu May 21, 2015 9:38 am
by Scott.Pearce
Try this:

Code: Select all
Dim PrintReportObject As New JiwaApplication.JiwaPrintReport.JiwaPrintReport
PrintReportObject.Setup()
      
Dim report As New JiwaApplication.Report.Configuration.Report
report.ReadRecordFromFileName("The report I want to generate - it must be in the database.rpt")

PrintReportObject.LoadReport(report)
PrintReportObject.UpdateReport()

Dim exOption As CrystalDecisions.Shared.ExportOptions = PrintReportObject.CrystalReportObject.ExportOptions

exOption.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
exOption.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile

Dim tempFolderPath As String = My.Computer.FileSystem.SpecialDirectories.Temp
If tempFolderPath .Trim.Length = 0 Then
    Throw New Exception("Unable to get temporary folder")
End If

Dim OutputFilename = "Output.pdf"
PrintReportObject.CrystalReportObject.ExportToDisk(ExportFormatType, My.Computer.FileSystem.CombinePath(tempFolderPath, OutputFilename))