Hi there,
I have a web app with the following structure
Application
Folder1
Folder2
IncidentReporting
reports
Inside in the folder IncidentReporting there is an aspx page that uses Response.Redirect to open a crystal report pdf file that is in a folder called reports. This is the code I use:
Dim ExportPath As String = "../reports"
Dim rptOrders As New CrystalDecisions.CrystalReports.Engine.ReportDocument
rptOrders.FileName = ExportPath + "DePuy Accident Report.rpt"
Dim myParameterValues As New ParameterValues()
Dim myDiscreteValue As New ParameterDiscreteValue()
myDiscreteValue.Value = CType(GridView1.SelectedValue, Integer)
myParameterValues.Add(myDiscreteValue)
rptOrders.DataDefinition.ParameterFields("AccidentID").ApplyCurrentValues(myParameterValues)
rptOrders.ExportToDisk(ExportFormatType.PortableDocFormat, ExportPath + Session.SessionID.ToString() + "DePuy Accident Report.pdf")
Response.Redirect(ExportPath + Session.SessionID.ToString() + "DePuy Accident Report.pdf")
I have tried putting the reports folder in other locations too but i still get the above error.
I would really apprecaite any help on this.
Thanks
I have a web app with the following structure
Application
Folder1
Folder2
IncidentReporting
reports
Inside in the folder IncidentReporting there is an aspx page that uses Response.Redirect to open a crystal report pdf file that is in a folder called reports. This is the code I use:
Dim ExportPath As String = "../reports"
Dim rptOrders As New CrystalDecisions.CrystalReports.Engine.ReportDocument
rptOrders.FileName = ExportPath + "DePuy Accident Report.rpt"
Dim myParameterValues As New ParameterValues()
Dim myDiscreteValue As New ParameterDiscreteValue()
myDiscreteValue.Value = CType(GridView1.SelectedValue, Integer)
myParameterValues.Add(myDiscreteValue)
rptOrders.DataDefinition.ParameterFields("AccidentID").ApplyCurrentValues(myParameterValues)
rptOrders.ExportToDisk(ExportFormatType.PortableDocFormat, ExportPath + Session.SessionID.ToString() + "DePuy Accident Report.pdf")
Response.Redirect(ExportPath + Session.SessionID.ToString() + "DePuy Accident Report.pdf")
I have tried putting the reports folder in other locations too but i still get the above error.
I would really apprecaite any help on this.
Thanks