Hi All,
I have uploaded my site on shared web server through filezilla. All pages working fine when i trying to open(load) page i get an error.
[COMException (0x800001fb): Invalid file name.] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +90 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +259 [CrystalReportsException: Load report failed.] CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +322 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +851 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +78 DawarBilling.testing.Page_Load(Object sender, EventArgs e) in D:\Desktop\Franchise\DawarBilling\DawarBilling\testing.aspx.cs:23 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +92 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
I have a doubt that y it's taking my local system path instead of server path even i used
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("~/testing.aspx");
}
Loading
Nitesh KejriwalPosted Aug 30, 2013, 3:42 AM
Gurjeet SinghPosted Aug 30, 2013, 3:37 AM
Nitesh KejriwalPosted Aug 29, 2013, 11:45 AM
Have you published a website on your web server or a web application?
Are you able to browse other pages apart from this page?
If you have published a website, the problem is not in your local file path that is shown in the code. Instead it is the line that is throwing the error. Try putting the code between try catch and see whether everything gets loaded fine. I think the issue is the website has not been published properly.
Gurjeet SinghPosted Aug 29, 2013, 11:28 AM
DawarBilling.testing.Page_Load(Object sender, EventArgs e) in D:\Desktop\Franchise\DawarBilling\DawarBilling\testing.aspx.cs:23
why it is taking my local system path.... even though i have uploaded site on server....
Iftikar HussainPosted Aug 29, 2013, 8:15 AM
Sanjeeb LenkaPosted Aug 29, 2013, 8:11 AM
protected void Page_Load(object sender, EventArgs e)
{
CrystalDecisions.CrystalReports.Engine.ReportDocument r = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
r.Load(Server.MapPath("~/CrystalReport3.rpt"));
crv.ReportSource = r;
}
Gurjeet SinghPosted Aug 29, 2013, 8:07 AM
first page button click
protected void Button1_Click(object sender, EventArgs e){ Response.Redirect("~/testing.aspx");
}
second page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testing.aspx.cs" Inherits="DawarBilling.testing" %>
<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>testing pagetitle>
head>
<body>
<form id="form1" runat="server">
<div>
It's testing page. <CR:CrystalReportViewer ID="crv" runat="server"
AutoDataBind="true" />
<br />
div>
form>
body>
html>
.cs file
public partial class testing : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CrystalDecisions.CrystalReports.Engine.ReportDocument r = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
r.Load(Server.MapPath("CrystalReport3.rpt"));
crv.ReportSource = r;
}
}
Iftikar HussainPosted Aug 29, 2013, 7:37 AM
Gurjeet SinghPosted Aug 29, 2013, 7:36 AM
Iftikar HussainPosted Aug 29, 2013, 7:07 AM
Gurjeet SinghPosted Aug 29, 2013, 6:50 AM
Gurjeet SinghPosted Aug 29, 2013, 6:49 AM
xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" />
<section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler">section>
sectionGroup>
sectionGroup>
configSections>
<appSettings>
<add key="CrystalImageCleaner-AutoStart" value="true" />
<add key="CrystalImageCleaner-Sleep" value="60000" />
<add key="CrystalImageCleaner-Age" value="120000" />
appSettings>
<connectionStrings>
connectionStrings>
<system.web>
<sessionState cookieless="false">
sessionState>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
assemblies>
compilation>
<customErrors mode="Off" />
<machineKey decryption="Auto" validation="SHA1" decryptionKey="AutoGenerate" validationKey="AutoGenerate" />
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
httpHandlers>
system.web>
<system.webServer>
<handlers>
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
handlers>
<validation validateIntegratedModeConfiguration="false" />
system.webServer>
configuration>
Gurjeet SinghPosted Aug 29, 2013, 6:45 AM
Iftikar HussainPosted Aug 29, 2013, 6:42 AM
Abhishek JainPosted Aug 29, 2013, 6:41 AM
Please check if the file is present at the same path, and if so it can be a permission issue, that the user with which code is running on IIS do not have sufficient permissions to access that folder or file.
Regards
Abhishek
Gurjeet SinghPosted Aug 29, 2013, 6:40 AM
CrystalDecisions.CrystalReports.Engine.ReportDocument r = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
r.Load(Server.MapPath("~/CrystalReport3.rpt"));
crv.ReportSource = r;
Iftikar HussainPosted Aug 29, 2013, 6:37 AM
Have you use LocalPath for crystal report?
Regards,
Iftikar