MemoryStream m_stream = new MemoryStream();
XlsExport xlsExport1 = new XlsExport();
xlsExport1.UseCellMerging = true;//试试看
xlsExport1.DisplayGridLines = false;
//xlsExport1.RemoveVerticalSpace = true;
//xlsExport1.AutoRowHeight = true;//自动行高
xlsExport1.MinColumnWidth = (float)0.5;
xlsExport1.Export(nrp.Document, m_stream);
m_stream.Position = 0;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment; filename=MyExport.xls");
Response.BinaryWrite(m_stream.ToArray());
Response.End(); |
|