Unable to find the report in the manifest resource

2019-02-17 08:20发布

I have a windows application written in C# and am trying to display crystal report using crystal report viewer. The name of my report is "receiptReport" and I am using following line to show report in viewer:

receiptReport rpt = new receiptReport();
crystalReportViewer.ReportSource = rpt;

I am receiving following error: Unable to find the report in the manifest resources. Please build the project, and try again.

I have tried by setting Build Action of report file 'receiptReport.rpt' to Embedded Resource but still now luck.. Im using VS2010..

8条回答
爷、活的狠高调
2楼-- · 2019-02-17 09:05

A lot of things go wrong with CR after a lot of googling one of these fixes will solve the problem.

1) Full FullResourceName property in the reports code file (.cs) will be wrong if the containing folder(s) has spaces in its name. The best fix is to rename the folder to remove spaces if you manually edit the code file the error will keep coming back

2) Make sure the build property of the rtp file is set to Embedded Resource

3) Use Developer Express for reporting and avoid all headaches in the first place

查看更多
可以哭但决不认输i
3楼-- · 2019-02-17 09:05

Well... I had the same problem. My solution was to edit the properties of the Report, and change the Custom Name Space.

Lets say that I was caling the report from Name Space "A", and my report was in the same Tool Name Space but in other DLL.

So, I've cleared the Custom Name Space... and rebuilt everything.

Problem solved for me.

查看更多
爷、活的狠高调
4楼-- · 2019-02-17 09:07

VS2010 in VB.Net. In the Solution Explorer window, I moved the .rpt file from the root folder to a sub folder for reports. This fixed the error for me.

查看更多
做自己的国王
5楼-- · 2019-02-17 09:13

This is a silly mistake done by a number of programmers. It actually happens only when you transfer or change a project or report from one project to another project.

"Unable to find the report in the manifest resources - Crystal Report / C#"

Solution:

Go into the project's Report Form's .CS file Now You have:

public override string FullResourceName 
{
    get 
    {
       //Note this path it must be yours project name  Or full path of Crystal report 
       return "FullPath_from_project_name.Crystalreport.rpt";
    }
    set 
    {
       // Do nothing
    }
}

I"m deadly sure you must Error free If not mail me with Error:kapil.dev824@yahoo.com

查看更多
太酷不给撩
6楼-- · 2019-02-17 09:13

My problem was solved by removing a folder which contain space . after i change it then this error is gone.

:)

查看更多
劫难
7楼-- · 2019-02-17 09:15

Name the Folder name which contains the Crystal Report, without Space.

For Eg: Folder Name "Report Section" as "ReportSection"

查看更多
登录 后发表回答