Hi Mattew, the Export option does not understand the parameters. The CrystalViewer displays the report correctly but it does not Export()......
Case 0 'Individuals Productivity and Overall Attendance
CrystalReportViewer1.Visible = True
crpt = New Individuals_Productivity_and_Overall_Attendance()
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = pass
myLogin.ConnectionInfo.UserID = userid
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ParameterFieldInfo = paramFields
CrystalReportViewer1.ReportSource = crpt
Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions()
CrDiskFileDestinationOptions.DiskFileName = "C:\myfilename.pdf"
CrExportOptions = crpt.ExportOptions
Try
With CrExportOptions
.DestinationOptions = CrDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crpt.Export()
Catch ex As Exception
MsgBox(ex.ToString)
Return
End Try
The following error occurs:
Server Error in '/SPOTReports' Application.
--------------------------------------------------------------------------------
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.ParameterFieldCurrentValueException: Missing parameter field current value.
Source Error:
Line 223: End With
Line 224:
Line 225: crpt.Export()
Line 226: 'Catch ex As Exception
Line 227: ' MsgBox(ex.ToString)
Source File: C:\Inetpub\wwwroot\SPOTReports\WebForm1.aspx.vb Line: 225
Stack Trace:
[ParameterFieldCurrentValueException: Missing parameter field current value.]
.K(String
, EngineExceptionErrorID )
.G(String , Int32 )
CrystalDecisions.CrystalReports.Engine.FormatEngine.internalSetReportInfo(RequestContext reqContext)
CrystalDecisions.CrystalReports.Engine.FormatEngine.internalGetViewContext(ReportPageRequestContext reqContext, * viewContext)
CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()
SPOTReports.WebForm1.StartReport() in C:\Inetpub\wwwroot\SPOTReports\WebForm1.aspx.vb:225
SPOTReports.WebForm1.Button2_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\SPOTReports\WebForm1.aspx.vb:610
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()