2

我将 packageTmp 复制到 inetpub/wwwroot,然后添加了一个网站并将其作为我的路径。

安装了水晶报告运行时,CRRuntime_32bit_13_0_4 - 但仍然没有工作。

我在 wwwroot/aspnet _client/systemweb/4_0_30319 中也有 Crystalreportviewers13 文件夹

这是我用水晶报表进入页面时遇到的错误。我可以知道路径在哪里定义吗?当我在 IIS 中部署我的应用程序时会出现此问题。

异常详细信息:System.Runtime.InteropServices.COMException:文件名无效。

源错误:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

堆栈跟踪:

[COMException (0x800001fb): Invalid file name.] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +95 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +270 [CrystalReportsException: Load report failed.] CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +333 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +877 CrystalDecisions.CrystalReports.Engine.ReportClass.Load(String reportName, OpenReportMethod openMethod, Int16 parentJob) +1183 CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport() +113 CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type) +53 CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataTable dataTable) ……

这是 .aspx 代码后面的 .cs 代码,用于 reportxx.rpt

m_reportxx = new reportxx();
CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;

DataTable dt = data.GetReport();

reportxx.SetDataSource(dt);

CrystalReportViewer1.ReportSource = m_reportxx;

我试过这个,它在 Visual Studio 环境中调试时工作。

4

2 回答 2

0

I know this is an old post. but For anyone still looking for the answer:

You need to register crystal reports in page markup

<% @ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

Set the property 'Copy to Output Directory' of the report to 'Copy always'

the path of the file in the crystalreportsource will be ~/bin/YOURFOLDER/YOURFILE

<CR: CrystalReportSource ID ="CrystalReportSource1" runat ="server">
            <Report FileName="~/bin/oilmovement/rptOMDayEnd.rpt">
            </Report>
        </CR: CrystalReportSource>

Now the report should work

于 2013-01-30T11:19:56.083 回答
0

就我而言,我在 2 天前发现了错误并且没有发现任何问题......最后我使用了 Procmon.exehttps://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx?f=255&MSPPError= -2147217396 ) 来跟踪错误。我按Result + is not + SUCCESS过滤,我尝试再次运行 Web 应用程序并出现 Error: ACCESS DENIED to Folder X。我授予 X 文件夹正确的权限并且工作正常。

于 2017-01-30T18:14:39.387 回答