Reply to topic  [ 3 posts ] 
Why does Applying Border Formatting change numberFormat 
Author Message

Joined: Wed May 09, 2007 8:36 am
Posts: 14
Location: Israel
Reply with quote
Post Why does Applying Border Formatting change numberFormat
I have an Excel workbook. The numberformat "###,###" is applied to some of the columns.

Assuming I do not touch any of the formatting of the cells, then this numberFormat stays. However if I apply a border format


Code:
//for (int j=1;j<20;j++) {
                           //   xlsMainTable.easy_getCell(row,j).setBorderStyles(Border.BORDER_THIN, Border.BORDER_NONE,Border.BORDER_THIN, Border.BORDER_THIN);
                           //   xlsMainTable.easy_getCell(row+1,j).setBorderStyles(Border.BORDER_NONE, Border.BORDER_THIN, Border.BORDER_THIN, Border.BORDER_THIN);
                           //}


then the numberFormat is removed, even though I would have claimed they have nothing to do with each other

Is there a way of getting around this?

Thank you


Sun Oct 18, 2009 10:47 am
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 199
Location: Brasov, Romania
Reply with quote
Post 
Formatting the cells overrides the column formatting.

You can create a clone after the column ExcelStyle, apply the border settings to the clone and set the style for the cells.

Code:
ExcelStyle xlsClonedStyle = xlsColumn. getStyle().Clone();
xlsClonedStyle. setBorderStyles(Border.BORDER_THIN, Border.BORDER_NONE,Border.BORDER_THIN, Border.BORDER_THIN);
xlsMainTable.easy_getCell(row+1,j).setStyle(xlsClonedStyle);


Mon Oct 19, 2009 7:46 am
Profile WWW

Joined: Wed May 09, 2007 8:36 am
Posts: 14
Location: Israel
Reply with quote
Post Feedback
Thank you Daniela for your posting. Unfortunately this did not work and I got much the same results as before...
Best wishes
Teniel


Tue Oct 20, 2009 10:18 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.