|
#2 -
10/06/2008 21:52:07
|
Reporta abuso
|
Link Permanente
|
|
RE: Ayuda plis, generar PDF de Crystal Reports sin visualizar reporte.
|
|
|
Acá está una subrutina para crear un PDF. _sPathReporte es la ruta donde está el archivo de Crystal (.rpt). _Reporte es el nombre del archivo .rpt. adjunto es el nombre del archivo PDF que se va a generar. Saludos.
Private Sub Exportar(ByVal adjunto As String) Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
_sPathReporte = CType(configurationAppSettings.GetValue("PathReportes", GetType(System.String)), String) rptDocument.Load(_sPathReporte & _Reporte & ".rpt") rptDocument.SetDataSource(_dtTabla) ReportViewer.ReportSource = rptDocument
Dim filedest As New CrystalDecisions.Shared.DiskFileDestinationOptions Dim o As CrystalDecisions.Shared.ExportOptions o = New CrystalDecisions.Shared.ExportOptions o.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat o.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile filedest.DiskFileName = System.IO.Directory.GetCurrentDirectory() & "\" & adjunto & ".pdf"
o.ExportDestinationOptions = filedest.Clone rptDocument.Export(o)
filedest = Nothing o = Nothing End Sub
|
|
|
|
|