cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to find the report in the manifest resources

Former Member
0 Kudos

<p>Hi!</p><p>I have problem using Crystal Report documents created in Visual Studio 2005 using the build-in version of Crystal Reports. If I create a project from scratch with one report and then some code to initialize and export the report to disk I get the following error message:</p><p>"Unhandled Exception: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Unable to find the report in the manifest resources. Please build the project, and try again."</p><p>I have tried using both the "Embedded resource" and the "Content" options during build, but with no luck at all. When using the Content option I explicitly load the rpt-file but no luck at all. Do anyone have a clue to what the problem is? I have absolutely no idea. The things worked in Visual Studio 2003 but not in 2005. What is the manifest resource?</p><p>Would really appreciate some help, thanks in advance!</p><p>My source code is below.</p><p>Best regards<br />Lars</p>class Program {<br /><font size="1"><font color="#0000ff"> public</font> <font color="#0000ff">static</font> <font color="#008080">TableLogOnInfo</font> CreateConnectionInfo(<font color="#0000ff">string</font> userID, <font color="#0000ff">string</font> password, <font color="#0000ff">string</font> serverName, <font color="#0000ff">string</font> databaseName) {<br /> <font color="#008080">TableLogOnInfo</font> conInfo = <font color="#0000ff">new</font> <font color="#008080">TableLogOnInfo</font>();<br /> conInfo.ConnectionInfo.UserID = userID;<br /> conInfo.ConnectionInfo.Password = password;<br /> conInfo.ConnectionInfo.ServerName = serverName;<br /> conInfo.ConnectionInfo.DatabaseName = databaseName;<br /><font color="#0000ff"> return</font> conInfo;<br /> }<br /><br /></font><font color="#0000ff"><font size="1"><font color="#0000ff"> public</font> <font color="#0000ff">static</font> <font color="#008080">ReportClass</font> CreatePersonalWillReport(<font color="#008080">TableLogOnInfo</font> conInfo, </font><font size="1"><font color="#0000ff">string</font> personID) {<br /> </font><font size="1"><font color="#008080">ReportClass</font> doc = <font color="#0000ff">new</font> <font color="#008080">ReportClass</font>();<br /> </font><font size="1">doc.Load(<font color="#800000">@"C:\Utveckling\reports\main\ClassLibrary1\bin\Debug\CrystalReport1.rpt"</font>);<br /> </font><font size="1"><font color="#008080">List</font><<font color="#008080">ReportParameter</font>> parameters = <font color="#0000ff">new</font> <font color="#008080">List</font><<font color="#008080">ReportParameter</font>>();<br /> </font><font size="1">parameters.Add(<font color="#0000ff">new</font> <font color="#008080">ReportParameter</font>(<font color="#800000">"@personID"</font>, personID));<br /> </font><font size="1"><font color="#0000ff">return</font> ApplyReportParameters(doc, parameters, conInfo);<br /> }</font></font><font color="#0000ff"> <p>&#160;</p><p><font size="1"><font color="#0000ff"> public</font> <font color="#0000ff">static</font> <font color="#0000ff">void</font> ExportReportToDisk(<font color="#0000ff">string</font> fileName, </font><font size="1"><font color="#008080">ReportClass</font> report, </font><font size="1"><font color="#008080">ExportFormatType</font> formatType) {<br /> </font><font size="1">report.ExportToDisk(formatType, fileName);<br /> </font><font size="1">}</font></p><p><font size="1"><font color="#0000ff"> protected</font> <font color="#0000ff">static</font> <font color="#008080">ReportClass</font> ApplyReportParameters(<font color="#008080">ReportClass</font> report, <font color="#008080">List</font><<font color="#008080">ReportParameter</font>> paramList, </font><font size="1"><font color="#008080">TableLogOnInfo</font> conInfo) {<br /> </font><font size="1"><font color="#0000ff">foreach</font> (<font color="#008080">Table</font> t <font color="#0000ff">in</font> report.Database.Tables) {<br /> </font><font size="1">t.ApplyLogOnInfo(conInfo);<br /> </font><font size="1">}</font></p><p><font size="1"> <font color="#0000ff">foreach</font> (<font color="#008080">Section</font> s <font color="#0000ff">in</font> report.ReportDefinition.Sections) {<br /> </font><font size="1"><font color="#0000ff">foreach</font> (<font color="#008080">ReportObject</font> ro <font color="#0000ff">in</font> s.ReportObjects) {<br /> </font><font size="1"><font color="#0000ff">if</font> (ro.Kind == CrystalDecisions.Shared.<font color="#008080">ReportObjectKind</font>.SubreportObject) { <br /></font><font size="1"><font color="#008080"> SubreportObject</font> sro = (<font color="#008080">SubreportObject</font>)ro;<br /> </font><font size="1"><font color="#008080">ReportDocument</font> doc = sro.OpenSubreport(sro.SubreportName);</font></p><p><font size="1"><font color="#0000ff"> foreach</font> (<font color="#008080">Table</font> t <font color="#0000ff">in</font> doc.Database.Tables) {<br /> </font><font size="1">t.ApplyLogOnInfo(conInfo);</font></p><p><font size="1"> }<br /> </font><font size="1">}<br /> </font><font size="1">}<br /> </font><font size="1">}<br /><br /> </font><font size="1"><font color="#0000ff">foreach</font> (<font color="#008080">ParameterFieldDefinition</font> paramField <font color="#0000ff">in</font> report.DataDefinition.ParameterFields) {<br /> </font><font size="1"><font color="#0000ff">foreach</font> (<font color="#008080">ReportParameter</font> rp <font color="#0000ff">in</font> paramList) {<br /> </font><font size="1"><font color="#0000ff">if</font> (paramField.Name == rp.Name) {<br /> </font><font size="1"><font color="#008080">ParameterValues</font> pv = paramField.CurrentValues;<br /> </font><font size="1"><font color="#0000ff">string</font> s = (<font color="#0000ff">string</font>)rp.Value.Value;<br /> </font><font size="1"><font color="#008080">ParameterDiscreteValue</font> pdv = <font color="#0000ff">new</font> <font color="#008080">ParameterDiscreteValue</font>();<br /> </font><font size="1">pdv.Value = s;<br /> </font><font size="1">pv.Add(pdv);<br /> </font><font size="1">paramField.ApplyCurrentValues(pv);<br /> </font><font size="1">}<br /> </font><font size="1">}<br /> </font><font size="1">}</font></p><p><font size="1"><font color="#0000ff"> return</font> report;</font></p><p><font size="1"> }</font></p><p>&#160;</p><p><font size="1"><font color="#0000ff"> static</font> <font color="#0000ff">void</font> Main(<font color="#0000ff">string</font>[] args) {<br /> </font><font size="1"><font color="#008080">TableLogOnInfo</font> conInfo = CreateConnectionInfo(<font color="#800000">"username"</font>, <font color="#800000">"password"</font>,<br /> </font><font size="1"><font color="#800000">"server"</font>, <font color="#800000">"database"</font>);<br /> </font><font size="1"><font color="#008080">ReportClass</font> report = CreatePersonalWillReport(conInfo, <font color="#800000">"-1291000956"</font>);<br /> </font><font size="1">ExportReportToDisk(<font color="#800000">"C:\temp\report.pdf"</font>, report, <font color="#008080">ExportFormatType</font>.PortableDocFormat);<br /> </font><font size="1">}</font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"><summary></font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> Helper class that contains parameter key/value pairs.</font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"></summary></font></font></p><p><font size="1"><font color="#0000ff">protected</font> <font color="#0000ff">class</font> <font color="#008080">ReportParameter</font> {</font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"><summary></font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> The parameter name.</font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"></summary></font></font></p><p><font size="1"><font color="#0000ff">private</font> <font color="#0000ff">string</font> name = <font color="#0000ff">null</font>;</font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"><summary></font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> The parameter value.</font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"></summary></font></font></p><p><font size="1"><font color="#0000ff">private</font> <font color="#008080">ParameterDiscreteValue</font> value = <font color="#0000ff">new</font> <font color="#008080">ParameterDiscreteValue</font>();</font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"><summary></font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> The parameter name.</font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"></summary></font></font></p><p><font size="1"><font color="#0000ff">public</font> <font color="#0000ff">string</font> Name {</font></p><p><font size="1"><font

color="#0000ff">get</font> {</font></p><p><font size="1"><font color="#0000ff">return</font> <font color="#0000ff">this</font>.name;</font></p><p><font size="1">}</font></p><p><font size="1"><font color="#0000ff">set</font> {</font></p><p><font size="1"><font color="#0000ff">this</font>.name = <font color="#0000ff">value</font>;</font></p><p><font size="1">}</font></p><p><font size="1">}</font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"><summary></font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> The parameter value.</font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"></summary></font></font></p><p><font size="1"><font color="#0000ff">public</font> <font color="#008080">ParameterDiscreteValue</font> Value {</font></p><p><font size="1"><font color="#0000ff">get</font> {</font></p><p><font size="1"><font color="#0000ff">return</font> <font color="#0000ff">this</font>.value;</font></p><p><font size="1">}</font></p><p><font size="1"><font color="#0000ff">set</font> {</font></p><p><font size="1"><font color="#0000ff">this</font>.value = <font color="#0000ff">value</font>;</font></p><p><font size="1">}</font></p><p><font size="1">}</font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"><summary></font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> The constructor.</font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"></summary></font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"><param name="name"></font><font color="#008000">the parameter name</font><font color="#808080"></param></font></font></p><p><font size="1"><font color="#808080">///</font><font color="#008000"> </font><font color="#808080"><param name="value"></font><font color="#008000">the parameter value</font><font color="#808080"></param></font></font></p><p><font size="1"><font color="#0000ff">public</font> ReportParameter(<font color="#0000ff">string</font> name, <font color="#0000ff">object</font> value) {</font></p><p><font size="1"><font color="#0000ff">this</font>.name = name;</font></p><p><font size="1"><font color="#0000ff">this</font>.value.Value = value;</font></p><p><font size="1">}</font></p><p><font size="1">}</font></p></font>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Lars,

 Have you read the CRnet_deployment.doc if not it may help fix your problem (It didnt mine but hey you may be lucky) See http://support.businessobjects.com/communitycs/technicalpapers/crnet_deployment.pdf

I have a similar issue but in 2003.net using the bundled CR package. I'm trying to use CR in a Web Service called from a Compact Framework device. I've confirmed I'm using the correct Merge Modules & my Build Actions are all set as stated in the CR Application Deployment document but it still spits out Unable to find the report in the manifest resources

...

I've looked extensively on the net and while others have had this problem the only advice I've seen revolves around embedded build actions and using the correct merge modules. There must be something else causing this problem and some one who has found a way round it?!?

If your that someone please take 5 minutes out and help a couple of guys in distress?

Thanks in advance,

Ian

Former Member
0 Kudos

I met this error message yesterday, and after massive googling, i got some suggestions like Embedded Resource in Build Action, or Content. But these were not the root cause. The real one is in myproject.csproj, just change RootNamespace and / or AssemblyName to correct name, you will be happy to see it is solved. To verify this in cryatal report, just delete the cs file of your crystall report file, make some change and rebuild it. in the regenerated cs file you will see the correct namespace. By the way, if you changed AssemblyName, remember to delete old.dll file from bin folder, it just give you compilation error of your-project&#39;s Global() initialization.

Former Member
0 Kudos

<div align="left">Thanks Mandune, my NS had changed and the old value was still there in my vbproj file. All changed, deleted all dll&#39;s and rebuilt still the same problem so back to square 1 for me but thanks anyway its probably got me one step closer. <br /> </div>

Former Member
0 Kudos

Have you check the NS of the file? And furthermore, all other files including solution, source control. and I feel you got hounded by the remnant of old NS. Just create a new workspace and project, copy everything except old project and solution files, no old bin files which generated by IDE (keep useful DLLs if applicable). As well no vticnf, vtipvt, vtiscript, vtitxt folders. By the way, check web.config to see whether anything would be suspicious. Hope this would do the trick for u.

Former Member
0 Kudos

Hi,

my case: from vs2005 to vs2010, windows application.

the same error

Unable to find the report in the manifest resources

Solution for my case:

Move the crystal report file to the directory where is the crystal report viewer, for the oldest reports,

for the new report, just create cr files into the same dir.

Answers (0)