Unable to find the report in the manifest resources
Asked Answered
N

11

8

I am saving all my Crystal Reports in one folder:

VOUCHERS-->SALE-->BILLFORMATS

For example: The location of the first report is:

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

Vegi_Manager is the root namespace.

When I build the project and try to use the report in the code, it throws an error:

Unable to find the report in the manifest resources

Is there some 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 .cs file to Vegi_Manager instead of Vegi_Manager.VOUCHERS.SALE.BILLFORMATS, it works but when the project is again compiled, it reverts back to Vegi_Manager.VOUCHERS.SALE.BILLFORMATS and again shows the same error.

What causes the above error?

Navarino answered 16/6, 2011 at 5:48 Comment(0)
P
10

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

Paolo answered 4/2, 2013 at 6:18 Comment(0)
M
4

If you get this error:

Unable to find the report in the manifest resources. 

Solved the problem on the following steps:

  1. Right click on your solution or crystal report folder. Go to Open Folder In File Explorer.
  2. Select your report. You have to choose only the rpt file not the cs file of your report.
  3. Copy the report & save it Desktop or another place.
  4. Now Delete the crystal report, If you are using source controller also delete from it.
  5. Now add the report as existing file where you save the rpt file, It will automatically generate it’s cs file.

  6. build & run your solution.

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

Mme answered 13/4, 2015 at 10:3 Comment(3)
@atik sarker, this post would have been deleted if I didn't come rescue it. In the future, link-only answers are often deleted, and it is good practice to put the essential instructions in the answer, for when the blog goes down or is unreachable. The answer is good, and we try to maintain a very high standard of communication, availability, conciseness, and preciseness on this site.Psychomancy
This answer is brilliant! It also works when one for some reason is trying to move a report definition from one VS project to another. Whilst just copying the files will NOT work. Stupid CrystalReport.... Thank you for saving me hours of fustration, this answer deserves more upvotes!Unitary
@Håkon Seljåsen Thank you.Mme
I
1

In my case it was because I had spaces in the names of the parent folder and report. If you have them named as Foo Bar just rename too FooBar and it should work.

Ipa answered 9/2, 2019 at 17:16 Comment(0)
L
1

You need to modify the path of your file in the constructor

Public Overrides Property FullResourceName() As String
    Get
        Return "**[path]**.BillFormat1.rpt"
    End Get
    Set
        'Do nothing
    End Set
End Property
Laurustinus answered 5/3, 2019 at 16:18 Comment(0)
G
1

In my case, the report's .cs file had a wrong namespace string value under the FullResourceName property. I had manually manipulated this file when I copied it from another project, but missed this one namespace value.

Gilt answered 20/11, 2019 at 0:5 Comment(1)
I had the same problem after renaming a project and changing its namespace. Changing the namespace in the FullResourceName Property helped. Thanks!Laceration
P
0

In my case this worked for me: 1. Click your rpt file in the Visual Studio 2. In the Properties Windows, check the Build Action 3. Change the value to 'Embedded Resource'

Potency answered 9/9, 2017 at 12:51 Comment(0)
J
0

Right click on the rpt file.Choose properties and go to Build Action Drop down list and choose embedded resource.Its work for me.Good luck all.

Jabiru answered 19/8, 2020 at 8:10 Comment(0)
D
0
  • Select .rpt file, and right click in file.
  • Chose ## Property
  • Set Biuld Action ## Embedded Resource
  • Set Copy to output Directory ## Do not copy
Dipteral answered 17/1, 2023 at 6:29 Comment(0)
L
0

It is more Easy To Solve ...

  • First of All locate where crystal report file "InvoiceReport.rpt" is located.
  • Remove the White Space in the name of folder or File where the report file is located. "My Reports"Make it "MyReports" then it is Done.
  • Rebuild and Run. OR
  • Change location of report file move to next folder.
Luce answered 25/12, 2023 at 2:33 Comment(0)
H
0

In my case, I had installed VS2022. The following steps helped for me:

  1. Close all windows in VS
  2. Open and save the report files. When asked if you want to save the reports in a new file format, answer yes.
  3. Delete the bin and obj folders
  4. Rebuild
Hellenic answered 28/6, 2024 at 10:41 Comment(0)
A
-1

Finally I could solve the problem

Just go to the references and choose all the dlls starts with crystalldesicion there.

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

build the project and save it all.

now its ready to action.

Amby answered 4/10, 2013 at 10:55 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.