Reply to topic  [ 3 posts ] 
Formatting Ranges 
Author Message

Joined: Wed Jan 16, 2008 9:13 am
Posts: 8
Reply with quote
Post Formatting Ranges
Can you set the formatting for a particular range? I know that with the ExcelTable class you can do a:

Code:
ExcelStyle xlsStyle = new ExcelStyle("Calibri",10,false,false,Color.Empty,Color.Empty)
xlsTable.easy_SetRangeStyle("A1:D11",xlsStyle);


But then after that, can you then go through and overwrite the style of say row 2 just to adjust that it's italicized without overwriting the other settings that it had?


Wed Jan 16, 2008 5:05 pm
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 189
Location: Brasov, Romania
Reply with quote
Post 
You can get the style for A1 cell for example and modify this style.
ExcelStyle xlsStyle = xlsTable.easy_getCell(0,0).getStyle().Clone()
or
ExcelStyle xlsStyle = xlsTable.easy_getRowAt(2).getStyle().Clone()
xlsStyle.setFont("Calibri")
xlsStyle.setFontSize(11)
xlsStyle.setBold(false)
xlsStyle.setItalic(false)
xlsStyle.setForeground(Color.Empty)
xlsTable.easy_setRangeStyle("A1:D11", xlsStyle)


Thu Jan 17, 2008 6:28 am
Profile WWW

Joined: Wed Jan 16, 2008 9:13 am
Posts: 8
Reply with quote
Post 
Daniela wrote:
You can get the style for A1 cell for example and modify this style.
ExcelStyle xlsStyle = xlsTable.easy_getCell(0,0).getStyle().Clone()
or
ExcelStyle xlsStyle = xlsTable.easy_getRowAt(2).getStyle().Clone()
xlsStyle.setFont("Calibri")
xlsStyle.setFontSize(11)
xlsStyle.setBold(false)
xlsStyle.setItalic(false)
xlsStyle.setForeground(Color.Empty)
xlsTable.easy_setRangeStyle("A1:D11", xlsStyle)


Ahh, I see. so basically you would have some default ExcelStyle (xlsStyleDefault) and you would clone it, set whatever different you wanted to set and then set the style for your range. Thanks!


Thu Jan 17, 2008 1:37 pm
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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.