/// <summary> /// 导出当前页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOutputCuttentPage_Click(object sender, EventArgs e) { List<Med_Model.Patient> listPatient = new List<Med_Model.Patient>(); Med_Model.Patient patient = new Med_Model.Patient(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); patient = BLL_Patient.GetPatientById(id); listPatient.Add(patient); patient = null; } NPOIHelper.DataTable3Excel(listPatient.ToADOTable(), "当前页救助对象列表", GetExportColumn()); }
/// <summary> /// 导出页面当前页数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOutputCurrentPage_Click(object sender, EventArgs e) { List<Med_Model.HelpStandard> listHelpStandard = new List<Med_Model.HelpStandard>(); Med_Model.HelpStandard helpStandard = new Med_Model.HelpStandard(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); helpStandard = BLL_HelpStandard.SelectHelpStandardById(id); listHelpStandard.Add(helpStandard); helpStandard = null; } NPOIHelper.DataTable3Excel(listHelpStandard.ToADOTable(), "当前页救助标准信息", GetExportColumn()); }