| 发表于:2007-03-31 16:19:52 楼主 |
孟老大,你的那个例子是datagrid,而我导出资料在form里面, <form id= "form1 " runat= "server " method= "post "> <table> <tr> <td align= "left "> <%=dvfstore.table.rows[i][ "specs "].tostring().trim() %> </td> </tr> </table> </from> response.clear(); response.buffer = true; response.charset = "gb2312 "; response.appendheader( "content-disposition ", "attachment;filename=filename.xls "); response.contentencoding = system.text.encoding.getencoding( "gb2312 ");//设置输出流为简体中文 response.contenttype = "application/ms-excel ";//设置输出文件类型为excel文件。 this.enableviewstate = false; system.globalization.cultureinfo mycitrad = new system.globalization.cultureinfo( "zh-cn ", true); system.io.stringwriter ostringwriter = new system.io.stringwriter(mycitrad); system.web.ui.htmltextwriter ohtmltextwriter = new system.web.ui.htmltextwriter(ostringwriter); this.form1.rendercontrol(ohtmltextwriter); response.write(ostringwriter.tostring()); response.end(); 这样导出excel结果还是1月8号。请问怎么解决? |
|
|
|
|