ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

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

#1 2015-02-25 11:03:58

gnetz
Member
Registered: 2015-02-11
Posts: 7

Excel Data Display problem

In excel worksheet column having text 10.10, but in Reogrid the column text displayed as 10.1 how to get the actual value as in Excel worksheet.

Offline

#2 2015-02-25 12:48:19

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

Re: Excel Data Display problem

In some cases where ReoGrid cannot read correctly the Excel cell format, but data loaded properly. It's possible to change the display format by set the data format:

using unvell.ReoGrid;
using unvell.ReoGrid.DataFormat;

...

var sheet = grid.CurrentWorksheet;

sheet.SetRangeDataFormat("A1:D5", // target range or cell
	CellDataFormatFlag.Number,
	new NumberDataFormatter.NumberFormatArgs
	{
		DecimalPlaces = 2,
		NegativeStyle = NumberDataFormatter.NumberNegativeStyle.Minus,
		UseSeparator = true,
	});

About cell format: http://reogrid.net/document/data-format/

Some similar problems have been resolved in current development version.

Offline

#3 2015-02-26 06:19:09

gnetz
Member
Registered: 2015-02-11
Posts: 7

Re: Excel Data Display problem

Excel Cell value is   "1.1.1" but in Reogrid displayed as 1/1/2001. here Datatype of  1.1.1  is String. Please give your feed back.
We disabled autoformatcell grid.currentworksheet.setting(worksheetsettings.Edit_autoFormatCell, False).

Offline

#4 2015-02-26 07:39:39

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

Re: Excel Data Display problem

Did you mean load from Excel? Currently when loading from Excel the Edit_AutoFormatCell does not work, it works only when cell editing. You could set the cell as text format after loading:

sheet.SetRangeDataFormat("A1:D5", CellDataFormatFlag.Text)

Offline

#5 2015-02-26 08:28:23

gnetz
Member
Registered: 2015-02-11
Posts: 7

Re: Excel Data Display problem

Thanks for your reply,
The Sample data as follows
a1 = 10.1 
a2 = 1.1.1
a3 = 20.10
a4 = 10.10
after formating cell as text we got the result as
a1 = 10.1 
a2 = 1.1.1
a3 = 20.1 (Here we need getcelltext = 20.10)
a4 = 10.1 (Here we need getcelltext = 10.10)
the entire column data type is string only.

Offline

#6 2015-02-26 08:33:57

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

Re: Excel Data Display problem

You could set a1 and a2 as text format, a3 and a4 as number format.

Edit: I have tested this. ReoGrid ignores the Excel format settings (text format) so this is a bug, it will be fixed as soon as possible. Thanks for reporting.

Last edited by Jingwood (2015-02-26 09:02:55)

Offline

#7 2015-03-24 15:04:44

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

Re: Excel Data Display problem

There is a preview release of 0.8.8.5. The problem above has been fixed in this version.

http://reogrid.net/preview-download/

Last edited by Jingwood (2015-03-24 15:05:04)

Offline

#8 2015-07-13 14:22:20

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

Re: Excel Data Display problem

I think this problem has been fixed in 0.8.9.x versions.

http://reogrid.net/download

Offline

Board footer

Powered by FluxBB