我用For将查询出来的DataTable绑定到Spread上,但是后台断点都能经过,前台不能显示。麻烦帮忙看一下。如果不可以可不可以远程解决一下。。。。多谢了。
protected void Page_Load(object sender, EventArgs e)
{
FpSpread1.Sheets[0].FrozenColumnCount = 4;
FpSpread1.Sheets[0].FrozenRowCount = 5;
this.FpSpread1.Sheets[0].Cells[0, 4].Text = DateTime.Now.Year.ToString() + "年" + ddlmonth.SelectedText.ToString() + "月技能职人力运营计划对比实绩报告书";
this.FpSpread1.EnableClientScript = true;
if (!Page.IsPostBack)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(chat3));
if (Request.QueryString["companyid"] != null)
ddlcompany.SelectedValue = Request.QueryString["companyid"].ToString();
if (Request.QueryString["year"] != null)
ddlyear.SelectedValue = Request.QueryString["year"].ToString();
else
ddlyear.SelectedValue = System.DateTime.Now.Year.ToString();
if (Request.QueryString["month"] != null)
ddlmonth.SelectedValue = Request.QueryString["month"].ToString();
else
ddlmonth.SelectedValue = System.DateTime.Now.Month.ToString();
System.Collections.Generic.Dictionary<string, object> dict = new System.Collections.Generic.Dictionary<string, object>();
dict.Add("@companyid", ddlcompany.SelectedValue);
dict.Add("@tableno", "tb" + "7");
dict.Add("@year", ddlyear.SelectedValue);
dict.Add("@month", ddlmonth.SelectedValue);
dict.Add("@language", language);
showdata(dict);
}
}
protected void showdata(System.Collections.Generic.Dictionary<string, object> dict)
{
BaseData.SMT_Comment Entity = new BaseData.SMT_Comment();
DataTable dt = Entity.ExecuteProcedure("SMT_GetReportData", dict).Tables[0];
for (int row = 0; row < dt.Rows.Count; row++)
{
for (int col = 0; col < dt.Columns.Count; col++)
{
this.FpSpread1.Sheets[0].Cells[5 + row, 4 + col].Text = dt.Rows[row][col].ToString();
}
}
} |