I have a LoadData function according to the search criteria and make girdview, I want to export data to excel from this girdview the path they have chosen.This is LoadData function
private void LoadData(string idPB, string StartDate, string ToDate)
{
hmweb.Services.cChuyenMuc mChiPhi = new hmweb.Services.cChuyenMuc();
DataTable dtb = new DataTable();
dtb = mChiPhi.ChiPhi_Search(idPB, StartDate, ToDate);
if (dtb.Rows.Count > 0)
{
pnlDanhSach.GroupingText = "Tìm th?y " + dtb.Rows.Count.ToString() + " mã chi phí";
grvDanhSach.DataSource = dtb;
grvDanhSach.DataBind();
//ViewState["dtList"] = dtb;
}
else
{
pnlDanhSach.GroupingText = "Tìm th?y 0 mã chi phí";
}
mChiPhi = null;
}
and this is Find
protected void lbtFind_Click(object sender, EventArgs e)
{
grvDanhSach.DataSource = null;
grvDanhSach.DataBind();
LoadData(cboPhongBan.SelectedValue, txtStartDate.Text.ToString(), txtToDate.Text.ToString());
}
he program is written in asp.net c #. Does anyone know detailed help. Thank you
Cao Cu HaoPosted Dec 9, 2014, 2:08 AM