ravindersinghblujay / tableexport-for-vaadin

Automatically exported from code.google.com/p/tableexport-for-vaadin
0 stars 2 forks source link

Doubles alignment issue #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a column with /Doubles that are formatted with "###,##0.00 S;###,##0.00 
H". This column is a simple one (not generated) and it's right aligned but the 
Excel Export for this column is left aligned.

see:
http://vaadin.com/forum-/message_boards/view_message/579716

Original issue reported on code.google.com by jnas...@gmail.com on 12 Sep 2011 at 2:15

GoogleCodeExporter commented 9 years ago
There's a couple of things going on here. First, the export was not formatting 
the cell with the format. Formatting was intended to be done by overriding the 
method:

protected CellStyle getDataStyle(final Object rootItemId, final int row, final 
int col)

However, this is a bit cumbersome and the CellStyle involves a lot more than 
just the DataFormat.  So, added a method:

public void setExcelFormatOfProperty(final Object propertyId, final String 
excelFormat) 

which allows the user to set an Excel string format for a column / property.  
You can still override getDataStyle for more control, but this allows targeted 
setting of column data formats.

It doesn't necessarily address the alignment issue which is more of an excel 
issue.

Original comment by jnas...@gmail.com on 17 Sep 2011 at 7:12

GoogleCodeExporter commented 9 years ago
Previous comment should have been accompanied by status change to fixed.  Doing 
it here.

Original comment by jnas...@gmail.com on 17 Sep 2011 at 7:12

GoogleCodeExporter commented 9 years ago
Found the alignment issue.  Was a bug (not an excel issue).  Involved setting 
the CellStyle alignment before setting the CellStyle.

Original comment by jnas...@gmail.com on 17 Sep 2011 at 9:26