locked
ReportViewer in local mode not displaying data from table in chart RRS feed

  • Question

  • User560349940 posted

    I am adding a table as the datsource to a ReportViewer displaying a chart and running in localmode, but the chart is empty. 

    The table definitely contains populated data rows.  The code is:

     string connStr =  "server=localhost;Trusted_Connection=true;database=MDX_Extract";

    SqlConnection conn = new SqlConnection(connStr);

    DataSet ds = new DataSet();

    using (SqlConnection conn = OpenSqlConnection())

    {

    SqlDataAdapter da = new SqlDataAdapter(sSQL, conn);

    da.Fill(ds);

           da.Dispose();

    }

     ReportViewer rV = FindReportViewer(activeReport);

    ReportDataSource rds = new ReportDataSource("DataSet1", ds.Tables[0]);

    ReportViewer1.LocalReport.DataSources.Clear();

    ReportViewer1.LocalReport.DataSources.Add(rds);

    ReportViewer1.LocalReport.Refresh();

     Any ideas what's happening?

    Monday, August 27, 2012 7:39 PM

Answers