You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Murphy, Mark" <mu...@metalexmfg.com> on 2015/06/29 20:19:45 UTC

Borders and ranges

I understand how to apply a border to an individual cell using a cell style, and I found documentation on how to apply a border to a merged range of cells, but how do I apply an outside border to a range of unmerged cells.

RE: Borders and ranges

Posted by "Murphy, Mark" <mu...@metalexmfg.com>.
I found the answer in RegionUtil. This API is still new to me. I am finding new things every time I use it.

-----Original Message-----
From: Dominik Stadler [mailto:dominik.stadler@gmx.at] 
Sent: Wednesday, July 01, 2015 8:35 AM
To: POI Users List
Subject: Re: Borders and ranges

Yes, unfortunately that is the way the Excel developers decided to put Styles into the format way back then (i.e. each different style needs to be defined and should be re-used across cells if possible) and it is not easy to shield the developer who is using POI from these complexities as it would likely cause big performance problems with larger spreadsheets with many different styles.

Unfortunately for now at least you have to decide on your own how you best re-use styles in your specific application of POI, but we are open to take suggestions (in code form with unit-test coverage, naturally :( ) of how you think it would be easier to manage these on top of POI.

Dominik.

On Tue, Jun 30, 2015 at 4:55 PM, Murphy, Mark <mu...@metalexmfg.com> wrote:
> Ok, but I don't see where I can apply those properties to a cell or range, Only to a CellStyle. So I then have to create a bunch of cell styles to handle Upper left corner, upper right corner, upper border, right border, left border, bottom border, bottom right corner, and bottom left corner, not to mention the special cases where I want to do a single cell, or a range that is one cell wide or one cell deep. And If I want to give some of these bordered cells a background, and others not, it becomes even more complex no? In Excel I can simply grab a range, and apply the borders I want. How do I do that with POI?
>
> -----Original Message-----
> From: Dominik Stadler [mailto:dominik.stadler@gmx.at]
> Sent: Monday, June 29, 2015 3:05 PM
> To: POI Users List
> Subject: Re: Borders and ranges
>
> Not sure I understand the question correctly, but wouldn't you just apply top/left/bottom/right borders as appropriate to get the larger box? At least that is what you can do in Excel to get such an effect...
>
> Dominik
> Am 29.06.2015 20:19 schrieb "Murphy, Mark" <mu...@metalexmfg.com>:
>
>> I understand how to apply a border to an individual cell using a cell 
>> style, and I found documentation on how to apply a border to a merged 
>> range of cells, but how do I apply an outside border to a range of unmerged cells.
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org


Re: Borders and ranges

Posted by Dominik Stadler <do...@gmx.at>.
Yes, unfortunately that is the way the Excel developers decided to put
Styles into the format way back then (i.e. each different style needs
to be defined and should be re-used across cells if possible) and it
is not easy to shield the developer who is using POI from these
complexities as it would likely cause big performance problems with
larger spreadsheets with many different styles.

Unfortunately for now at least you have to decide on your own how you
best re-use styles in your specific application of POI, but we are
open to take suggestions (in code form with unit-test coverage,
naturally :( ) of how you think it would be easier to manage these on
top of POI.

Dominik.

On Tue, Jun 30, 2015 at 4:55 PM, Murphy, Mark <mu...@metalexmfg.com> wrote:
> Ok, but I don't see where I can apply those properties to a cell or range, Only to a CellStyle. So I then have to create a bunch of cell styles to handle Upper left corner, upper right corner, upper border, right border, left border, bottom border, bottom right corner, and bottom left corner, not to mention the special cases where I want to do a single cell, or a range that is one cell wide or one cell deep. And If I want to give some of these bordered cells a background, and others not, it becomes even more complex no? In Excel I can simply grab a range, and apply the borders I want. How do I do that with POI?
>
> -----Original Message-----
> From: Dominik Stadler [mailto:dominik.stadler@gmx.at]
> Sent: Monday, June 29, 2015 3:05 PM
> To: POI Users List
> Subject: Re: Borders and ranges
>
> Not sure I understand the question correctly, but wouldn't you just apply top/left/bottom/right borders as appropriate to get the larger box? At least that is what you can do in Excel to get such an effect...
>
> Dominik
> Am 29.06.2015 20:19 schrieb "Murphy, Mark" <mu...@metalexmfg.com>:
>
>> I understand how to apply a border to an individual cell using a cell
>> style, and I found documentation on how to apply a border to a merged
>> range of cells, but how do I apply an outside border to a range of unmerged cells.
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: Borders and ranges

Posted by "Murphy, Mark" <mu...@metalexmfg.com>.
Ok, but I don't see where I can apply those properties to a cell or range, Only to a CellStyle. So I then have to create a bunch of cell styles to handle Upper left corner, upper right corner, upper border, right border, left border, bottom border, bottom right corner, and bottom left corner, not to mention the special cases where I want to do a single cell, or a range that is one cell wide or one cell deep. And If I want to give some of these bordered cells a background, and others not, it becomes even more complex no? In Excel I can simply grab a range, and apply the borders I want. How do I do that with POI?

-----Original Message-----
From: Dominik Stadler [mailto:dominik.stadler@gmx.at] 
Sent: Monday, June 29, 2015 3:05 PM
To: POI Users List
Subject: Re: Borders and ranges

Not sure I understand the question correctly, but wouldn't you just apply top/left/bottom/right borders as appropriate to get the larger box? At least that is what you can do in Excel to get such an effect...

Dominik
Am 29.06.2015 20:19 schrieb "Murphy, Mark" <mu...@metalexmfg.com>:

> I understand how to apply a border to an individual cell using a cell 
> style, and I found documentation on how to apply a border to a merged 
> range of cells, but how do I apply an outside border to a range of unmerged cells.
>

Re: Borders and ranges

Posted by Dominik Stadler <do...@gmx.at>.
Not sure I understand the question correctly, but wouldn't you just apply
top/left/bottom/right borders as appropriate to get the larger box? At
least that is what you can do in Excel to get such an effect...

Dominik
Am 29.06.2015 20:19 schrieb "Murphy, Mark" <mu...@metalexmfg.com>:

> I understand how to apply a border to an individual cell using a cell
> style, and I found documentation on how to apply a border to a merged range
> of cells, but how do I apply an outside border to a range of unmerged cells.
>