Click here to Skip to main content
15,888,257 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Configuration;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ReportDocument rd = new ReportDocument();
        DataSet1 ds1 = new DataSet1();
        DataTable dt = new DataTable();
        dt.TableName = "Crystal Repoart";
        dt = getallordeer();
        ds1.Tables[0].Merge(dt);
        rd.Load("C:\\Documents and Settings\\sakshi.k\\My Documents\\Visual Studio 2010\\WebSites\\WebSite2\\CrystalReport.rpt");
        rd.SetDataSource(ds1);
        CrystalReportViewer1.ReportSource = rd;

    }
    public DataTable getallordeer()
    {
        SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["learnConnectionString"].ConnectionString);
        SqlCommand cmd = new SqlCommand();
        DataSet ds = null;
        SqlDataAdapter Sda;
        try
        {
            conn.Open();
            cmd.CommandText = "select customer_name,order_id,product_name,product_qty from customer1";
            cmd.CommandType = CommandType.Text;
            cmd.Connection = conn;
            ds = new DataSet();
            Sda = new SqlDataAdapter(cmd);
            Sda.Fill(ds);
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        finally
        {
            cmd.Dispose();
            conn.Close();
        }
        return ds.Tables[0];
    }
}


while making simple crystal report the error is coming
microsoft jscript error : object does not support this property or method

i have no idea about jscript please tell me how to remove this error please.
Posted
Updated 23-Apr-13 23:51pm
v3
Comments
[no name] 24-Apr-13 3:13am    
You have spelling mistake.
Karthik Harve 24-Apr-13 3:28am    
[Edit] pre tags added for code block.
RelicV 24-Apr-13 5:55am    
Sakshi, can you provide the front-end design code also..?
sakshi111 24-Apr-13 6:43am    
i created a data set of four coloumn customer_name,order_id,product_name and product_qty
and also i create customer1 table of customer_id,customer_name,order_id,product_name and product_qty.and than i add crystal report and 1 .aspx page and in that page i include crystalreport viewer and code it
Chinmaya C 24-Apr-13 8:12am    
Are you sure the problem is with Crystal Report.

Try commenting the following code and run the page. if the same error is coming the then problem is with something other.
CrystalReportViewer1.ReportSource = rd;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900