Could not find report in manifest resources

I save all my Crystal Reports in one folder:

VOUCHERS-->SALE-->BILLFORMATS 

For example: location of the first report:

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

Vegi_Manager is the root namespace.

When I create a project and try to use the report in code, it gives an error message:

 Unable to find the report in the manifest resources 

Is there a problem with the .cs file?

The code:

 //------------------------------------------------------------------------------ // <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; } } } 

Sometimes I change the namespace in the .cs file to Vegi_Manager instead of Vegi_Manager.VOUCHERS.SALE.BILLFORMATS, it works, but when the project compiles again, it goes back to Vegi_Manager.VOUCHERS.SALE.BILLFORMATS and shows the same error again.

What causes the above error?

+6
source share
4 answers

I got the same error because I changed the build action in my report from Embedded to Resource. If you change the build action to an Embedded resource, this should fix the problem. To change it, click on the .rpt file and go to its advanced properties and click the "Action" drop-down list.

+6
source

If you get this error:

 Unable to find the report in the manifest resources. 

The problem is solved in the following steps:

  • Right-click on the folder of your solution or crystal. Open the "Open Folder" folder in the file explorer.
  • Select a report. You should select only the rpt file, not the cs file of your report.
  • Copy the report and save it on your desktop or in another place.
  • Now delete the crystal report, if you are using the source controller, also delete it.
  • Now add the report as an existing file in which you save the rpt file. It will automatically generate its cs file.

  • create and run your solution.

Source: http://atikpassion.blogspot.in/2014/08/unable-to-find-report-in-manifest.html

+4
source

In my case, it worked for me: 1. Click on your rpt file in Visual Studio 2. In the "Windows Properties" window, check the "Build action" checkbox 3. Change the value to "Built-in resource"

0
source

Finally, I was able to solve the problem

Just go to the links and select all the dll starts with crystalldesicion there.

After you select all of them, find the Copy Local property in the property table, now change its value to true .

create a project and save it all.

now ready for action.

-1
source

Source: https://habr.com/ru/post/890654/


All Articles