将Excel中的列格式化为自定义 [英] Format column in excel to custom

查看:145
本文介绍了将Excel中的列格式化为自定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将网格视图导出为ex​​cel时,我想将单个列的格式更改为长度为4的自定义数字格式,即



如果值为10则存储在excel单元格中为0010

如果值为100,则它将存储为0100

如果为1000则将存储为1000



在导出

when exporting grid view to excel i want to change the format of a single column to custom number format with a length of 4 i.e

if value is 10 it is stored in excel cell as 0010
if value is 100 then it will be stored as 0100
if it is 1000 then it will be stored as 1000

What style should i add or what format should i add in my .aspx page before export

推荐答案

String.Format(我应该在我的.aspx页面中添加什么样的格式或者我应该添加什么格式? {0:0000},值;
String.Format("{0:0000}", value);


这篇关于将Excel中的列格式化为自定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆