Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The system cannot find the file specified.

Status
Not open for further replies.

cathiec

Programmer
Oct 21, 2003
139
0
0
IE
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
 
try:
Dim ExportPath As String = server.mappath("../reports")


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top