cancel
Showing results for 
Search instead for 
Did you mean: 

The type or namespace name - could not be found

Former Member
0 Kudos

Visual Studio 2005

Crystal Reports 2008 (12.4.0.966)

Trying to build my project which has a pdf that will be created via Crystal Reports. Getting the following error:

Error 1 The type or namespace name 'PrintPDF' could not be found (are you missing a using directive or an assembly reference?)

Line causing the error:

using (PrintPDF reportPrint = new PrintPDF())

{

...

}

The Crystal Report file is named PrintPDF.rpt.

I have the following references (that were added automatically upon creating an .rpt file):

CrystalDevisions.CrystalReports.Engine

CrystalDevisions.Enterprise.Framework

CrystalDevisions.Enterprise.InfoStore

CrystalDevisions.ReportSource

CrystalDevisions.Shared

My .cs file has the following includes:

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Shared;

Any ideas what is causing the error? This is a project that was built successfully 10 months ago but I had to make a few changes to the .rpt file and now it won't rebuild.


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I'm using the same code in another project and it's building fine. To further show what's going on here, I have created a new .rpt (CrystalReport1.rpt) file in the project and I'm able to get it to recognize that file (along with the CrystalReportBillDetail.rpt and CrystalReportBillSummary.rpt files), however it doesn't recognize my PrintPDF.rpt or PrintPDFMulti.rpt files.

CR files:

http://i.imgur.com/Bnh32.png

CrystalReport1.rpt recognized:

http://i.imgur.com/EXOAv.png

PrintPDF.rpt (or PrintPDFMulti.rpt) not recognized:

http://i.imgur.com/O1kqm.png

former_member183750
Active Contributor
0 Kudos

Hello Kyle

There should be an actual physical copy of the PrintPDF.rpt and PrintPDFMulti.rpt files under your project directory. If you do find these, remove the references to those reports from your project:

Then re-add the files to the project.

Also, remove your references to:

CrystalDecisions.Enterprise.Framework

CrystalDecisions.Enterprise.InfoStore

These are not needed. And add a reference to crystaldecisions.web

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

I have removed the rpt files and re-added them and also removed the references and re-added them to no luck.

Upon further investigation, the reason that this isn't working is because my .rpt files aren't auto-generating anything in their .cs files. They're simply empty. So it's missing things like:

public class CrystalReportBillSummary : ReportClass {

        public CrystalReportBillSummary() {

        }

How do I get the .cs files to auto-generate like they're supposed to?

former_member183750
Active Contributor
0 Kudos

If there is a C:\temp directory rename it.

Do a repair on .NET 2008

Do a repair on CR 2008 (perhaps better yet, uninstall CR and re-install CR)

- Ludek

Former Member
0 Kudos

Problem fixed. .cs files weren't generating due to group headers being empty after updating datasource.

Answers (0)