Пример #1
0
    protected void btn_Expot_Click(object sender, EventArgs e)
    {
        string sql = @"select a.nID, (CONVERT(float,a.Allprice)/100) ordermoney,c.TypeName,c.Zhanghao,c.Huming,c.[address],
                     b.MemberPhone ,'' nullvalue,b.nickname,b.MemberCode,d.chongfu from  MoneyOrder a 
                     join  ML_Member b on a.AnID=b.nID left join [Bank] c on a.AnID=c.Cid 
                     left join (
 
	                     select cc.Zhanghao chongfu from  MoneyOrder aa join  ML_Member bb on aa.AnID=bb.nID
	                    left join [Bank] cc on aa.AnID=cc.Cid where aa.OrderState=0
	                     group by cc.zhanghao having count(cc.zhanghao)>1
 
                     ) d on c.Zhanghao=d.chongfu
                      where a.OrderState=0 order by c.Huming ";

        DataTable dt = her.ExecuteDataTable(sql);

        if (dt.Rows.Count > 0)
        {
            GridViewExpot.DataSource = dt;
            GridViewExpot.DataBind();
            string day = System.DateTime.Now.ToString("yyyy-MM-dd");
            //string _Name = her.ExecuteScalar(sql).ToString();
            PageHelper.DataTableToExcel(this.GridViewExpot, day + "提现.xls");
        }
        else
        {
            ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('无未处理数据可导出')</script>");
        }
    }
Пример #2
0
    protected void btn_Expot_Click(object sender, EventArgs e)
    {
        GridViewExpot.DataSource = GetSource();
        GridViewExpot.DataBind();
        string sql   = "select tRealName from dbo.ML_Member where nID=" + _ID;
        string _Name = her.ExecuteScalar(sql).ToString();

        PageHelper.DataTableToExcel(this.GridViewExpot, _Name + "_报名课程.xls");
    }