The type or name of the CrystalReportViewer namespace does not exist in the CrystalDecisions.Web namespace (do you miss the assembly reference?)

m gets the following error when using Crystal report in my asp.net 3.5 a3-level application

the type or namespace name 'CrystalReportViewer' does not exist in the namespace 'CrystalDecisions.Web' (are you missing an assembly reference?)

covered namespaces: =

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using MorvelNew.Report;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web;
+5
source share
3 answers
  • Right-click "Links" and select "Add Link ..."
  • Go to the "Extensions" section
  • Find "CrystalDecisions.Web"

and add a namespace.

+7
source

missing multiple builds in web.config

    <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
    <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
    <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
    <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies>
0
source
  protected void Button1_Click1(object sender, EventArgs e)
{

        SqlCommand command = new SqlCommand();
       // command.CommandText = "select tt.id , t.number , t.destination, t.name, t.code, t.arrtime, t.deptime, t.date, t.vechialnum, t.dep_from, t.repStore,tt.tito, tt.toDate, tt.cat, tt.tube, tt.carton, tt.bag, tt.other, tt.value, tt.remark from TripSheet1 t join TripSheet tt on t.number =tt.number where tt.number  =@id";
        command.CommandText = " select * from tripsheet where id=@id";
        command.Parameters.Add("@id", SqlDbType.Int).Value = TextBox1.Text;
        command.Connection = con;

        SqlDataAdapter adapter = new SqlDataAdapter(command);
        DataSet dataset = new DataSet();
           adapter.Fill(dataset, "tripsheet");

        ReportDocument MedicalReport = new ReportDocument();
        MedicalReport.Load(Server.MapPath("TripReport.rpt"));
    MedicalReport.SetDataSource(dataset.Tables["tripsheet"]);

        CrystalReportViewer1.ReportSource = MedicalReport;
        CrystalReportViewer1.DataBind();

        command.Dispose();
        Label1.Text = string.Empty;

    }
0

All Articles