Foros del Web » Programación para mayores de 30 ;) » .NET »

Exportar a PDF un reporte de CrystalReportViewer

Estas en el tema de Exportar a PDF un reporte de CrystalReportViewer en el foro de .NET en Foros del Web. [email protected] I have problem exporting a Crystal Report. He two ways used by me with different errors. Any help would be appreciated. --This code I ...
  #1 (permalink)  
Antiguo 01/07/2004, 07:25
 
Fecha de Ingreso: julio-2004
Mensajes: 1
Antigüedad: 20 años, 4 meses
Puntos: 0
Sonrisa Exportar a PDF un reporte de CrystalReportViewer

[email protected] I have problem exporting a Crystal Report. He two ways used by me with different errors. Any help would be appreciated.



--This code I can see my reports that use parameters passed by me....

Crystalreportviewer2.Visible = True
crpt1 = New Overall_Transactions_Performed_by_Individuals()
For Each myTable In crpt1.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = pass
myLogin.ConnectionInfo.UserID = userid
myTable.ApplyLogOnInfo(myLogin)
Next

Crystalreportviewer2.ParameterFieldInfo = paramFields
Crystalreportviewer2.ReportSource = crpt1




'Export Button
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
Dim myReport As New Individuals_Productivity_and_Overall_Attendance()
myExportFile = "c:\inetpub\wwwroot\SPOTReports\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions ()
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = myReport.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
myReport.Export()

End Sub



Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.ParameterFi eldCurrentValueException: Missing parameter field current value.

Source Error:


Line 632: .ExportFormatType = .ExportFormatType.PortableDocFormat
Line 633: End With
Line 634: myReport.Export()
Line 635:
Line 636: End Sub


================================================== ================================================== ======================

'Export Button
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
'Dim myReport As New Individuals_Productivity_and_Overall_Attendance()
myExportFile = "c:\inetpub\wwwroot\SPOTReports\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions ()
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = crpt1.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
crpt1.Export()

End Sub



Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 446: myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions ()
Line 447: myDiskFileDestinationOptions.DiskFileName = myExportFile
Line 448: myExportOptions = crpt1.ExportOptions
Line 449: With myExportOptions
Line 450: .DestinationOptions = myDiskFileDestinationOptions
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:30.