Пример #1
0
    /// <summary>
    /// 导出Excel
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnExcel_Click(object sender, EventArgs e)
    {
        DataTable dt = SetDataOrExpectNumBLL.GetAllExpectNumDateFromConfig();

        if (dt.Rows.Count < 1)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001712", "对不起,没有可以导出的数据!")));
            return;
        }

        else
        {
            Excel.OutToExcel(dt, GetTran("001745", "期数对应日期信息"), new string[] { "ExpectNum=" + GetTran("000045", "期数"), "Date=" + GetTran("000613", "日期") });
        }
    }
Пример #2
0
    private void getInfo()
    {
        ///从结算表中获取所有的日期和期数
        DataTable dt = SetDataOrExpectNumBLL.GetAllExpectNumDateFromConfig();

        ViewState["sorttable"] = dt;
        DataView dv = new DataView(dt);

        if (ViewState["sortstring"] == null)
        {
            ViewState["sortstring"] = "ExpectNum asc";
        }
        dv.Sort = ViewState["sortstring"].ToString();

        this.gvExpectNumDate.DataSource = dv;
        this.gvExpectNumDate.DataBind();
        Translations_More();
    }