Last post Nov 23, 2010 11:16 AM by manchako
Nov 23, 2010 10:49 AM|manchako|LINK
I created a project with a crystal report that worked nicely and I had to reinstall crystal reports on my computer and now it cant find crystaldecisions in my code! I get the error:
The type or namespace name 'CrystalDecisions' could not be found (are you missing a using directive or an assembly reference?)
and my code is as follows:
public partial class Protected_Admin_Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
// Get the filePath
string filePath = Server.MapPath("~/Admin/Invoice.rpt");
// Create new instance of the CrystalReportViewerClass
CrystalReportViewer rptViewer = new CrystalDecisions.Web.CrystalReportViewer();
// Create new instance of the Report Document
ReportDocument rptDoc = new ReportDocument();
// Load the rpt file into the ReportDocument Class
// Set the already loaded rpt file into the CrystalReportViewer class
rptViewer.ReportSource = rptDoc;
// Add the control to the page
Nov 23, 2010 10:57 AM|sansan|LINK
You need to add references for CrystalDecisions.Engine, Shared, Web. If you had already done that, most likely you might be missing Crystal Reports runtime
Browse the link and see which version you need for Crystal RunTime.
Nov 23, 2010 11:01 AM|manchako|LINK
I've got the crystal runtime for .NET 4.0 installed (using visual studio 2010)...any other ideas?
The reference for CrystalDecisions.Engine etc..gives the same error saying crystaldecisions cant be found!
Nov 23, 2010 11:04 AM|manchako|LINK
...runtime engine for .NET 4.0 (using visual studio 2010)
Nov 23, 2010 11:05 AM|sansan|LINK
Did you add CrystalDecision references to the project? You can find it in References in Solution Explorer. I am assuming that your references are causing this issue.
Nov 23, 2010 11:16 AM|manchako|LINK