Click here to Skip to main content
15,917,456 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am getting error in this part of code when I deploy the application.
C#
ReportDocument rd=new ReportDocument();
string path=Server.MapPath(@"AuditReport");
rd.Load(path);

Please Help.

Thank You.
Posted
Updated 7-Dec-11 1:58am
v2

Hi,
I think you did the syntatic mistake while assigning the parameter @AuditReport to the string path,

Try this one,
string path=Server.MapPath(@AuditReport);


The following code returns the file path for the root of your Web site,
String rootPath = Server.MapPath("~");


Ref:
http://msdn.microsoft.com/en-us/library/ms178116.aspx#Y3188[^]

Regards,
Blusathish
 
Share this answer
 
error is because of not getting ur assigned path.
for this use :
C#
string path=Server.MapPath("~\\AuditReport");
 
Share this answer
 
If u provide error then i get more information. Please check IIS permission of that folder and Crystal Report configuration on that machine also.

Please post ur error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900