如何在c#编码中将数据类型设置为excel列 [英] how to set datatype to excel column in c# coding
本文介绍了如何在c#编码中将数据类型设置为excel列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将数据导出到excel,因为我想在excel中为几列设置数据类型,例如日期,数字等。在c#
Iam exporting data to excel in that I want to set datatype for few columns in excel for example date, number etc. In c #
推荐答案
之类的,
Something like,
Range r = (Excel.Range)worksheetobject.Cells[1,1];
r.EntireColumn.NumberFormat = "MM/DD/YYYY"; // date
r.NumberFormat = "
0.00; // 货币
-KR
-KR
这篇关于如何在c#编码中将数据类型设置为excel列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文