' Create a temporary filename Dim strPDF As String = MapPath("Reports/TO" & Session.SessionID & ".pdf") ' Create report Dim rpt As New TravelOrderList ' Set report params 'rpt.SetParameterValue("ReportTitle", "Report Title") 'rpt.SetParameterValue("ReportSubTitle", "Sub Title") ' Set report datasource rpt.SetDataSource(ds)Dim CrExportOptions As ExportOptions Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions() Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions() CrDiskFileDestinationOptions.DiskFileName = strPDF CrExportOptions = rpt.ExportOptions With CrExportOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat .DestinationOptions = CrDiskFileDestinationOptions .FormatOptions = CrFormatTypeOptions End With rpt.Export() ' Force download(in DNN) FileSystemUtils.DownloadFile(strPDF) ' Delete temp file IO.File.Delete(strPDF)
HTH
No comments:
Post a Comment