protected void Button1_Click(object sender, EventArgs e) { string type = Type.Value; LossiModel hm1 = new LossiModel(); // DataBaseLayer db = new DataBaseLayer(); // string str = "select * from lossiInfor where type ='" + type + "'"; DataTable dt = hm1.finLossiInfor(type); System.DateTime currentTime = new System.DateTime(); currentTime = System.DateTime.Now; string now = currentTime.ToString("yyyyMMdd"); CreateExcel(dt, "application/ms-excel", "库房报损信息" + now); }
} //提供数据的方法 public dotNetFlexGrid.DataHandlerResult DotNetFlexGrid1DataHandler(dotNetFlexGrid.DataHandlerParams p) { dotNetFlexGrid.DataHandlerResult result = new dotNetFlexGrid.DataHandlerResult(); result.page = p.page; //设定当前返回的页号 result.total = 100; //总计的数据条数,此处用100进行模拟,查询和筛选时需要根据实际 LossiModel hm1 = new LossiModel(); var Type = ""; if (p.extParam.ContainsKey("Type")) { Type = p.extParam["Type"]; } int pageSize = p.rp; result.table = hm1.finLossiInfor(Type); return(result); }