Server.MapPath just transforms a "URL" path into a physical path. It doesn't
care where the file is or even if a file named this way exists.
Server.MapPath("file.txt") will just return a path to this file (wether it
exists or not) relative to the directory of the currently executing page.
You'll have to fix the path in Server.MapPath such as
Server.MapPath("~/myreports/CrystalReportSummary.rpt").
See the doc for details...
--
Patrice
"Craig" <No****@hotmail.com> a écrit dans le message de
news:%2****************@TK2MSFTNGP09.phx.gbl...
In my code I have this line of code....
CrystalReportViewer1.ReportSource =
Server.MapPath("CrystalReportSummary.rpt")
I moved the file, CrystalReportSummary.rpt, and I get an error.
The value for Server.MapPath("CrystalReportSummary.rpt") is the old path,
not the new one.
Is this not supposed to be dynamic? How can I correct this?
Thanks