I will share my colleague's questions today.
The Crystal report project uses strongtyped report. Errors are always reported during running.
Dim crInventoryListReport as New InventoryList () 'report File
CrystalReportViewer1.ReportSource = crInventoryListReport
I checked the kb of BO. Only one article said that when using a strongly typed report, The buildanction of the report should select the embedded resource. There is no problem with this. After looking at the settings, he also set the embedding.
Http://support.businessobjects.com/library/kbase/articles/c2012623.asp
However, an error is reported, indicating that the report cannot be found in the resource list.
I used ildasm to check whether all resources are there. In fact, this problem must be a namespace problem.
In fact, an error is reported mainly because the namespace of the cs file after your report must be consistent with the namespace of the root rpt file (mainly the directory structure)
For more information, see.
Compile your exe, such as a.exe
Ildasm a.exe/out: a. il
He will dump all the resource files and check your rpt file name. For example, MontaqueInc. ProjectA. InventoryList. rpt.
Make sure that the namespace of your InventoryList. cs file is MontaqueInc. ProjectA.
The main code is:
Type type1 = base. GetType ();
Stream stream2 = type1.Module. Assembly. GetManifestResourceStream (type1, this. ResourceName );
The namespace of reportclass to match the resource file.
Unfortunately, most of this is the reason I mentioned, while bo and Microsoft did not provide the relevant kb. I checked the ms news group, many of these problems are not identified by answer. :(