gpt4 book ai didi

c# - 无法在 list 资源中找到报告

转载 作者:太空狗 更新时间:2023-10-29 20:03:36 25 4
gpt4 key购买 nike

我将所有 Crystal Reports 保存在一个文件夹中:

VOUCHERS-->SALE-->BILLFORMATS

例如:第一个报告的位置是:

VOUCHERS-->SALE-->BILLFORMATS-->BillFormat1.rpt

Vegi_Manager 是根命名空间。

当我构建项目并尝试在代码中使用报告时,它会抛出一个错误:

Unable to find the report in the manifest resources

.cs文件有问题吗?

代码:

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

namespace Vegi_Manager.VOUCHERS.SALE.BILLFORMATS {
using System;
using System.ComponentModel;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.CrystalReports.Engine;


public class BillFormat1 : ReportClass {

public BillFormat1() {
}

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

public override bool NewGenerator {
get {
return true;
}
set {
// Do nothing
}
}

public override string FullResourceName {
get {
return "Vegi_Manager.VOUCHERS.SALE.BILLFORMATS.BillFormat1.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];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmName {
get {
return this.DataDefinition.ParameterFields[0];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmJurisdiction {
get {
return this.DataDefinition.ParameterFields[1];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmPhoneNo {
get {
return this.DataDefinition.ParameterFields[2];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmMobileNo {
get {
return this.DataDefinition.ParameterFields[3];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmDetails {
get {
return this.DataDefinition.ParameterFields[4];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmAddress {
get {
return this.DataDefinition.ParameterFields[5];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmCity {
get {
return this.DataDefinition.ParameterFields[6];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmState {
get {
return this.DataDefinition.ParameterFields[7];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamFirmBankDetails {
get {
return this.DataDefinition.ParameterFields[8];
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public CrystalDecisions.Shared.IParameterField Parameter_ParamBillNo {
get {
return this.DataDefinition.ParameterFields[9];
}
}
}

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

public CachedBillFormat1() {
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public virtual bool IsCacheable {
get {
return true;
}
set {
//
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public virtual bool ShareDBLogonInfo {
get {
return false;
}
set {
//
}
}

[Browsable(false)]
[DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public virtual System.TimeSpan CacheTimeOut {
get {
return CachedReportConstants.DEFAULT_TIMEOUT;
}
set {
//
}
}

public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
BillFormat1 rpt = new BillFormat1();
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;
}
}
}

有时我将 .cs 文件中的命名空间更改为 Vegi_Manager 而不是 Vegi_Manager.VOUCHERS.SALE.BILLFORMATS,它有效但当项目再次编译时,它恢复回到 Vegi_Manager.VOUCHERS.SALE.BILLFORMATS 并再次显示相同的错误。

导致上述错误的原因是什么?

最佳答案

我收到了同样的错误,因为我将报告的构建操作从嵌入式资源更改为资源。如果您将构建操作更改为嵌入式资源,它应该可以解决问题。要更改它,请单击 .rpt 文件,然后转到其高级属性并单击“生成操作”下拉列表。

关于c# - 无法在 list 资源中找到报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6367624/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com