EasyXLS
http://forum.easyxls.com/

Define a sheet background color
http://forum.easyxls.com/viewtopic.php?f=5&t=740
Page 1 of 1

Author:  mariodagot [ Wed Oct 01, 2008 4:46 am ]
Post subject:  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

Author:  oana [ Thu Oct 02, 2008 5:35 am ]
Post subject: 

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);
 }

Author:  mariodagot [ Tue Oct 07, 2008 4:08 am ]
Post subject: 

Thanks,
It works. <- src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" />

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/