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

后端 未结 8 1216
孤街浪徒
孤街浪徒 2021-01-12 22:13

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 fol

8条回答
  •  不思量自难忘°
    2021-01-12 22:45

    My issue was that the directory's name where my reports was located was all numbers in order to correspond to the client codes we use. So what happened was that Visual Studio named the class Reports._1234567, while my directory was "\Reports\1234567". When I renamed the folder "_1234567" then the folder matched the class name and everything worked fine.

    In the report's code behind the FullResourceName property is this:

    public override string FullResourceName {
                get {
                    return "app700.Reports._1234567.CrystalReport1.rpt";
                }
                set {
                    // Do nothing
                }
            }
    

    The underscore character was added by VS because you can't have a class name that does not start with a letter or underscore.

提交回复
热议问题