Peter's Gekko

Sponsors

The Lounge

Wicked Cool Jobs

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Merging webapps. Moving (typed) Crystal reports from one application to another.

Two of my projects got so entangled that the only way out was merging them into one. They were several asp.net apps which had (code) references to each other. Two of them refering each other made the situation unworkable. Building the setup packages resulted in one working or the other working, depending which package I built first. When creating a setup package vs first builds all the projects in the package. When an assembly is refered it will be rebuilt and included. When an assembly is included in more than one package it is rebuild more than once. Leading to versioning hell.

I created a new web app and created some folders in it (from the VS solution explorer !) To these folders I added the content and code from the former apps. Works like a snap. Except for my (what else ?) Crystal reports. 90% of the conversion time was spent on getting these to work. This time the process was interesting.

Including the report “as is” leads to a succesfull build but an enigmatic error message at runtime:

Unable to find the report in the manifest resources

My apps use strong typed reports and reportdocuments from the component palette

Several observations

  • A report looks like a rpt file. Behind the scenes is a (generated) cs file
  • This cs file is generated when you save the report design. See the custom tool in the proprties of a report.
  • That code is generated in the namespace of the application.
  • The reportdocument is refred in the namespace of the page hosting it

The combination of the last two results in the error. To get things working took me these steps.

  1. Include the reports in the project
  2. Open the designer and save (to regenerate the report code)
  3. Make sure the pages on which the report is used are in the default namespace of the application
  4. Do not use reportdocuments

Step 3 is easier in C# then VB. Here you see the namespace in the code behind. Changing the name will have the desired effect. To get an overview of the namespaces in your app use the class viewer.

Too much of the reportdocument component is hard coded. Creating the report on the fly works just as well.

private MotivatieRaport mv = new MotivatieRaport();
dataSetProjektTonen.Merge(Projekt.ToonBaarProjekt(id));
mv.SetDataSource(dataSetProjektTonen);
CrystalReportViewer1.ReportSource = mv;

The only extra line is the first one.

Peter

 


Posted 06-08-2004 8:16 AM by pvanooijen
Filed under:

[Advertisement]

Comments

Gopinath wrote Problem in crystal report
on 07-26-2004 1:22 AM
Hi,
while displaying crystal report in my aspx screen. i got an error...

"Unable to find the report in the manifest resources. Please build the project, and try again.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.InternalException: "Unable to find the report in the manifest resources. Please build the project, and try again.

Source Error:


Line 98:
RptEquipmentDetails rep = new RptEquipmentDetails();
Line 99:
CREqventsreport.Visible=true;
Line 100:
rep.SetDataSource(dtView);
Line 101:
CREqventsreport.ReportSource = rep;
Line 102:
//rep.SetDataSource(RptTable) ;


Source File: e:\projects_2002\jdproject_raj\jdprojectapp_raj\jdproject\equipment\equipmentreport.aspx.cs Line: 100

Darren Grafton wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 09-20-2004 4:34 PM
I had the same Error using VS .Net and making a win Forms App after changing the name of my project. Just removing and then bringing it back fixed me up ;-))
Ken Lange wrote Thank You
on 10-27-2004 3:43 PM
I had the same problem after moving a crystal report from one .Net Windows Form project to another.

"Unable to find the report in the manifest resources"

I struggled with this problem for a while before I found your explanation. Opening the report int the CR designer and saving it again caused the "code-behind" file to be re-written and got rid of the error.

Thank you.

Ken
Jane wrote non-embedded report files
on 11-22-2004 4:34 PM
I am trying to separate .rpt files from main application. Having ReportDocument component heavily used in all load events will require a lot of changes. Will appreciate any help...
Dhanya wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 07-07-2005 11:04 PM
Hi,
When i got this error, i changed my build action in the report properties, from 'none' to 'embedded resource'. It worked.

Thanks,
Dhanya
vaibhav wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 02-16-2006 11:09 AM
Thanks peter....
Paul Gaynier wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 05-03-2006 10:00 AM
Thanks Peter for the webpage.

Thanks Ken for your comment. Having the same problem and all I needed to do was open the CrystalReport in the designer and make a change so that it had to be saved before a recompiling. It worked fine.
srinath wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 06-24-2006 2:17 PM
I have a problem regarding the calculation and displaying of graph using crystal reports.
MAHESH wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 01-18-2007 5:48 AM

I HAVE SAME PROBLEM AND IAM VERY MUCH NEW TO CRYSTAL REPORTS.

EXCEPTION DETAILS:

"CrystalDecisions.CrystalReports.Engine.InternalException: "Unable to find the report in the manifest resources. Please build the project, and try again."

private Database crDatabase;

if (str_rpttyp == "regionwise")

crDatabase = crReportDocument1.Database;

//AT THIS STATEMENT IT IS SHOWING ABOVE ERROR.

CAN ANYBODY HELP

pvanooijen wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 01-18-2007 7:20 AM

As you are new to CR my first suggestion is to switch to SQL reporting services, which might save you a lot of frustration.

Case else: didn't all suggestions work ?

N.Mahesh wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 02-21-2007 6:33 AM

Iam new to CR's I have same problem .I found soln in net as opening report in CR designer and saving it ,or In properties change build action none to embedded resources.but none of them is not working.

Looking for help.

Thanks in advance.

pvanooijen wrote re: Merging webapps. Moving (typed) Crystal reports from one application to another.
on 02-21-2007 7:23 AM

In case you are new to CR may I repeat my last comment ?

I gave up on CR...

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us