Crystal Report - Exportar Reportes a PDF con Group Name

 
Vista:

Exportar Reportes a PDF con Group Name

Publicado por Lizeth Jimenez (1 intervención) el 21/11/2008 07:37:37
Primeramente un saludo, lo que pasa es que estoy intentando exportar los reportes a pdf y eso ya lo he conseguido, lo que me aqueja en este momento es que los reportes deben exportarse a pdf por grupo con el nombre del grupo.pdf, he logrado exportar los reportes por rangos de paginas pero esto de exportarlos por groupname creo que se me esta complicando mucho, cualquier idea es bienvenida, les anexo mi codigo para ver si me pueden ayudar.
Gracias y saludos a todos
Private Sub report(ByVal rpt As ReportDocument)
Dim Directorio As String = Application.LocalUserAppDataPath
Dim PathFile As String = Directorio & "Reporte.pdf"
PathFile = ExportToPDF(rpt, "Reporte.pdf")
End Sub
Public Function ExportToPDF(ByVal rpt As ReportDocument, ByVal NombreArchivo As String) As String
Dim vFileName As String
Dim diskOpts As New DiskFileDestinationOptions
Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()
CrFormatTypeOptions.FirstPageNumber = 1
CrFormatTypeOptions.LastPageNumber = 3
CrFormatTypeOptions.UsePageRange = True
Try
With rpt.ExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile

.ExportFormatType = ExportFormatType.PortableDocFormat
.ExportFormatOptions = CrFormatTypeOptions

End With

vFileName = "c:" & NombreArchivo
If File.Exists(vFileName) Then File.Delete(vFileName)
diskOpts.DiskFileName = vFileName
rpt.ExportOptions.DestinationOptions = diskOpts
rpt.Export()
Catch ex As Exception
Throw ex
End Try

Return vFileName
End Function
Ojala alguien pueda ayudarme por que me urge hacer esto.
bye
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder