Export data with DataTable to Excel

xiaoxiao2021-03-14  187

I now changed a way, export data with DataTable, what way can be set to export the export Excel font size, color ??? code as follows: Private void OutputExcelThree (DataTable DT) {httpresponse response; resp = page.Response; respon .ContentEncoding = System.Text.Encoding.GetEncoding ( "GB2312"); resp.AppendHeader ( "Content-Disposition", "attachment; filename =" HttpUtility.UrlEncode (strName, System.Text.Encoding.UTF8) "( " Httputility.urlencode (qdatetext, system.text.encoding.utf8) ") " " .xls "); string colheaders =" ", ls_item =" "; int i = 0;

DATAROW [] Myrow = DT.SELECT ("");

转载请注明原文地址:https://www.9cbs.com/read-129382.html

New Post(0)