日期:2014-05-20  浏览次数:20975 次

rdlc饼图动态绑定数据?
我想在饼图上动态绑定数据,不绑动态绑定是可以正常显示的,可一绑定就出问题,代码如下,请帮我看看哪里出问题了:
 MySQLConnection conn = new MySQLConnection(new MySQLConnectionString("localhost", "School", "root", "").AsString);
  conn.Open();
  MySQLCommand commn = new MySQLCommand("set names gbk", conn);
  commn.ExecuteNonQuery();

  string strSql = "SELECT t1.*,t2.Name CompanyName,t3.Name SchoolName" +
  " FROM T_MonthlyGather t1,T_Company t2,T_School t3" +
  " WHERE t1.CompanyId=t2.ROW_ID AND t1.SchoolId=t3.ROW_ID AND LEFT(BeginDate,7)='2009-10'";
  MySQLDataAdapter mda = new MySQLDataAdapter(strSql, conn);

  DataTable dt = new DataTable();
  mda.Fill(dt);
  conn.Close();

  this.ReportViewer1.LocalReport.DataSources.Clear();
  this.ReportViewer1.LocalReport.ReportPath = Server.MapPath("Graphics.rdlc");
  //在这里测试过,dt里面已经查出数据了,数据是对了,可是一绑定就不能正常显示了
  this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1_DataTable1", dt));
  this.ReportViewer1.LocalReport.Refresh();

------解决方案--------------------
你的RDLC设置有问题吧
------解决方案--------------------
是不是类别字段和数据字段设错了?
------解决方案--------------------
帮你顶上去,现在我也再做,只不过做不出来..
------解决方案--------------------
我也刚在弄这个。。帮忙顶下。。

 很多不会。。
------解决方案--------------------
资料太少分析不出来,可以跟踪下
------解决方案--------------------
强势帮顶。。叽叽喳喳围观