Re: [jopendocument] spreadsheet range

2016-06-15 Thread Sylvain Cuaz

Le 06/06/2016 14:59, James Pollard a écrit :



Hi, I'm trying to workout how to select a range of cells then change the 
background colour
This is what I've tried so far as well as variations of this

inSheet.getCellAt("Sheet1.".concat((startPoint.concat(":")).concat(endPoint))).setBackgroundColor(Color.green);

I'm assuming I've tried doing it the wrong way

Any help pointing me in the right direction would be appreciated
James


Hi,

You must iterate on each cell :

final Range r = Range.parse(rangeString);
for (int y = r.getStartPoint().y; y <= r.getEndPoint().y; y++) {
for (int x = r.getStartPoint().x; x <= r.getEndPoint().x; x++) {
getCellAt(x, y).setBackgroundColor(color);
}
}

Cheers,
Sylvain

--

--- 
You received this message because you are subscribed to the Google Groups "jOpenDocument" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[jopendocument] spreadsheet range

2016-06-06 Thread James Pollard


Hi, I'm trying to workout how to select a range of cells then change the 
background colour
This is what I've tried so far as well as variations of this

inSheet.getCellAt("Sheet1.".concat((startPoint.concat(":")).concat(endPoint))).setBackgroundColor(Color.green);

I'm assuming I've tried doing it the wrong way

Any help pointing me in the right direction would be appreciated
James

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.