ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum no longer accepts new user registrations, please report your question, problem and feedback to the issue page of ReoGrid on Github. Thanks for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-02-22 14:02:35

maibo
Member
Registered: 2016-01-27
Posts: 15

日期型数据没法导出到excel

导出是空格,什么内容都没有

Offline

#2 2016-02-22 15:16:26

oops
Moderator
Registered: 2015-11-03
Posts: 54

Re: 日期型数据没法导出到excel

测试了一下格式设置确实无法正确导出,不过结果不是空格,只有纯文本内容,能否请提供一下你的设置类型的代码。

Offline

#3 2016-02-23 08:59:46

maibo
Member
Registered: 2016-01-27
Posts: 15

Re: 日期型数据没法导出到excel

var dateTimeFormatArgs = new unvell.ReoGrid.DataFormat.DateTimeDataFormatter.DateTimeFormatArgs
                {
                    CultureName = "zh-CN",
                    Format = "yyyy-MM-dd",
                };//日期型
                worksheet.SetRangeDataFormat(worksheet.Ranges[0, 0, 1, 1], unvell.ReoGrid.DataFormat.CellDataFormatFlag.DateTime, dateTimeFormatArgs);
                worksheet[0, 0] = DateTime.Now;
                worksheet.SetRangeDataFormat(worksheet.Ranges[0, 1, 1, 1], unvell.ReoGrid.DataFormat.CellDataFormatFlag.Number, new unvell.ReoGrid.DataFormat.NumberDataFormatter.NumberFormatArgs
                {
                    DecimalPlaces = 1,
                });
                worksheet[0, 1] = 10.00M;
数字类型也是。还有小数位显示应该为一位,实际上是两位都显示出来。

Offline

#4 2016-02-26 14:00:01

oops
Moderator
Registered: 2015-11-03
Posts: 54

Re: 日期型数据没法导出到excel

已经确认两个类型的导出问题,DateTime类型的data和decimal类型的数值确实无法导出。问题将在下一个版本中修正。感谢提出。

Offline

#5 2016-02-27 15:13:33

Jing
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: 日期型数据没法导出到excel

This problem has been fixed in version 1.2, which can be downloaded from: https://reogrid.net/download. Thanks for reporting!

Offline

#6 2016-02-28 06:12:50

maibo
Member
Registered: 2016-01-27
Posts: 15

Re: 日期型数据没法导出到excel

谢谢!

Offline

Board footer

Powered by FluxBB