【问题标题】:Crystal Reports水晶报表
【发布时间】:2010-10-08 10:03:14
【问题描述】:

我将 ASP.Net 应用程序从 .NET 1.1 升级到 .NET 2.0。所有网页仍然可以正常工作,但无法加载 Crystal Reports。

堆栈跟踪:

Load report failed.
StackTrace:    at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportClass.Load(String reportName, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)

有人知道为什么加载不出来吗?

架构:Windows Server 2008 (IIS 7)

调用报告的代码:

ReportClass ApprovalPage=new CustomerJobLabelApprovalMod();
ApprovalPage.SetDataSource(reportDataSet);

CustomerJobLabelApprovalMod 的代码:

//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a tool.
//     Runtime Version: 1.1.4322.2407
//
//     Changes to this file may cause incorrect behavior and will be lost if 
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

namespace LabelVault {
    using System;
    using System.ComponentModel;
    using CrystalDecisions.Shared;
    using CrystalDecisions.ReportSource;
    using CrystalDecisions.CrystalReports.Engine;


    public class CustomerJobLabelApprovalMod : ReportClass {

        public CustomerJobLabelApprovalMod() {}

        public override string ResourceName {
            get {
                return "CustomerJobLabelApprovalMod.rpt";
            }
            set {
                // Do nothing
            }
        }

        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section1 {
            get {
                return this.ReportDefinition.Sections[0];
            }
        }

        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section2 {
            get {
                return this.ReportDefinition.Sections[1];
            }
        }

        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section3 {
            get {
                return this.ReportDefinition.Sections[2];
            }
        }

        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section4 {
            get {
                return this.ReportDefinition.Sections[3];
            }
        }

        [Browsable(false)]
        [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public CrystalDecisions.CrystalReports.Engine.Section Section5 {
            get {
                return this.ReportDefinition.Sections[4];
            }
        }
    }

    [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")]
    public class CachedCustomerJobLabelApprovalMod : Component, ICachedReport {

        public CachedCustomerJobLabelApprovalMod() {}

        public virtual bool IsCacheable {
            get {
                return true;
            }
            set {}
        }

        public virtual bool ShareDBLogonInfo {
            get {
                return false;
            }
            set {}
        }

        public virtual System.TimeSpan CacheTimeOut {
            get {
                return CachedReportConstants.DEFAULT_TIMEOUT;
            }
            set {}
        }

        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
            CustomerJobLabelApprovalMod rpt = new CustomerJobLabelApprovalMod();
            rpt.Site = this.Site;
            return rpt;
        }

        public virtual string GetCustomizedCacheKey(RequestContext request) {
            String key = null;
            // // The following is the code used to generate the default
            // // cache key for caching report jobs in the ASP.NET Cache.
            // // Feel free to modify this code to suit your needs.
            // // Returning key == null causes the default cache key to
            // // be generated.
            // 
            // key = RequestContext.BuildCompleteCacheKey(
            //     request,
            //     null,       // sReportFilename
            //     this.GetType(),
            //     this.ShareDBLogonInfo );
            return key;
        }
    }
}

【问题讨论】:

  • 请发布更多信息,如果您调用报告中的代码会很棒。

标签: .net crystal-reports


【解决方案1】:

稍后进行大量艰苦的谷歌搜索......

我必须授予Windows\Temp 的网络服务权限,因为 Crystal Reports 获取该用户,而不是被模拟的用户(具有管理员权限)。所以该目录,而不是 IIS 目录,是正在使用的那个。

这很令人沮丧,但现在可以了!

【讨论】:

    【解决方案2】:

    我似乎记得不久前做过这个,我在 web.config 中找到了一些对旧 Crystal Reports 内容的引用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-05
      • 2010-10-24
      • 2014-04-01
      • 2021-04-11
      相关资源
      最近更新 更多