Reply to topic  [ 3 posts ] 
Define a sheet background color 
Author Message

Joined: Wed Oct 01, 2008 4:19 am
Posts: 10
Reply with quote
Post Define a sheet background color
Hi,

Is there any way to set an entire sheet background color?
I've tried:

Code:
        ExcelStyle xlsStyleData = new ExcelStyle();
        xlsStyleData.setBackground(Color.WHITE);
       
        ExcelTable tbl = sheet.easy_getExcelTable();
        tbl.easy_setRangeStyle(0, 0, 300, 255, xlsStyleData);


but this code takes too long and the excel is bigger (in MB) than it should (if I do the same thing but using excel directly).

Thanks in advance.
Regards.
Mário


Wed Oct 01, 2008 4:46 am
Profile

Joined: Wed Nov 07, 2007 4:42 am
Posts: 59
Reply with quote
Post 
Hi,

You can make the columns white only. See sample code below:
Code:
//Get the table of the first worksheet
   ExcelTable tbl = sheet.easy_getExcelTable();
   
   //Create an empty cell
   tbl.easy_getCell(0, 255);

   ExcelStyle xlsStyleData = new ExcelStyle();
   xlsStyleData.setBackground(Color.WHITE);

   for (int column=0; column<256; column++){
       tbl.easy_getColumnAt(column).setStyle(xlsStyleData);
 }


Thu Oct 02, 2008 5:35 am
Profile WWW

Joined: Wed Oct 01, 2008 4:19 am
Posts: 10
Reply with quote
Post 
Thanks,
It works. <- src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" />


Tue Oct 07, 2008 4:08 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.