shoyeb Aziz

shoyeb Aziz

  • NA
  • 72
  • 0

Crystal Report not Running On Server

Mar 30 2010 7:04 AM

Hi AlL,
I am Facing Problem abt Crystal Report

i am using this code

public partial class mReport4Test : System.Web.UI.Page
{

private ReportDocument CrystalRpt;
private ReportDocument mySubRepDoc;
private ReportClass ReportObject;
private string tmpReportName;

protected void Page_Load(object sender, EventArgs e)
{


CrystalRpt = new ReportDocument();
ConnectionInfo CrystalConn = new ConnectionInfo();
TableLogOnInfo tblLogonInfo = new TableLogOnInfo();
ReportObject = new ReportClass();

TableLogOnInfo CrystalLogonInfo = new TableLogOnInfo();
ParameterField CrystalParameter = new ParameterField();
ParameterFields CrystalParameters = new ParameterFields();
ParameterDiscreteValue CrystalParameterDV = new ParameterDiscreteValue();

TableLogOnInfo ConInfo = new TableLogOnInfo();
SubreportObject mySubReportObject;
mySubRepDoc = new ReportDocument();


string ReportName = Server.MapPath("CrystalReport1.rpt");

Random MyRandomNumber = new Random();
tmpReportName = ReportName.Replace(".rpt", "")+ MyRandomNumber.Next().ToString() + ".rpt";
File.Copy(ReportName, tmpReportName, true);

CrystalRpt.Load(tmpReportName);

}
while running on my local server it runs fine...... while uploading on server and running its shows error

Access to the path 'E:\Inetpub\vhosts\leelagroup.net\httpdocs\testing718770553.rpt' is denied.
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: System.UnauthorizedAccessException: Access to the path 'E:\Inetpub\vhosts\leelagroup.net\httpdocs\testing718770553.rpt' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

 
then what i have to do ?