第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

導(dǎo)出EXCEL按鈕的問(wèn)題

導(dǎo)出EXCEL按鈕的問(wèn)題

ibeautiful 2018-12-06 15:17:10
我做了一個(gè)導(dǎo)出EXCEL的按鈕,代碼如下,有兩個(gè)問(wèn)題。1.導(dǎo)出的EXCEL是2003版的,用office2003打開是正常的,但是用office2010打開就亂碼,直接在office2003復(fù)制黏貼到office2010的新建文檔里面也是亂碼,有沒(méi)有辦法解決,正常來(lái)說(shuō)2003的文件在2010打開是沒(méi)問(wèn)題的。他的提示是寫著“單元格數(shù)據(jù)太大”,考慮到有的用戶可能只裝2003或只裝2007或只裝2010,所以導(dǎo)出的文件要做到全兼容才行.2.導(dǎo)出的文字字體是Arial Unicode MS,這個(gè)有沒(méi)有辦法改,改成宋體之類,當(dāng)然這個(gè)不是很關(guān)鍵,導(dǎo)出來(lái)后自己手動(dòng)改也可以,關(guān)鍵是上面那個(gè)問(wèn)題。后臺(tái)代碼:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;using System.Drawing;using System.IO;using System.Text;public partial class test : System.Web.UI.Page{? protected void Page_Load(object sender, EventArgs e)? {? }? protected void Button1_Click(object sender, EventArgs e)? {? Export("application/ms-excel", "bijiben.xls");? }? private void Export(string FileType, string FileName)? {? Response.Charset = "GB2312";? Response.ContentEncoding = System.Text.Encoding.UTF7;? Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());? Response.ContentType = FileType;? this.EnableViewState = false;? StringWriter tw = new StringWriter();? HtmlTextWriter hw = new HtmlTextWriter(tw);? GridView1.RenderControl(hw);? Response.Write(tw.ToString());? Response.End();? }? public override void VerifyRenderingInServerForm(Control control)? {? }}
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 287 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)