Java导出excel时采用application/vnd.ms-excel的方式,怎样设置某列的格式 5
Java导出excel时采用application/vnd.ms-excel的方式,怎样设置某列的格式,我数据导出后长的数字在表格中尾部都变成0了,比如201012311...
Java导出excel时采用application/vnd.ms-excel的方式,怎样设置某列的格式,我数据导出后长的数字在表格中尾部都变成0了,比如201012311651099114933的号码,导出后变成2.01012E+20,编辑框是201012311651099000000
展开
3个回答
展开全部
设置那一列的格式啊 以文本格式输出
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这是我的一个示例,你可以参照一下:
private void Export(string FileType, string FileName)
{
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF8;
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);
Repeater1.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
}
protected void Button1_Click(object sender, EventArgs e)
{
Export("application/ms-excel", "订单报表.xls");
}
private void Export(string FileType, string FileName)
{
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF8;
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);
Repeater1.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
}
protected void Button1_Click(object sender, EventArgs e)
{
Export("application/ms-excel", "订单报表.xls");
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在java那里将数字换成string就没问题了。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询