You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Rohit Cha <rk...@gmail.com> on 2015/10/26 11:54:23 UTC

Want to know if a feature is available or not

Hi,

     I am having an Excel-File containing both normal cells and Merged
Cells I am working on getting data of the Excel File,so i want to know if
there is any feature such that on giving a specific cell that will tell me
weather the cell is a merged cell or not and if the cell is a merged cell
give me the value of first row,colon of the cell(i mean merged cell value)

          ThankYou

Re: Want to know if a feature is available or not

Posted by Blake Watson <bl...@pnmac.com>.
There is a cache, essentially. Check out:

https://poi.apache.org/apidocs/org/apache/poi/hssf/record/aggregates/MergedCellsTable.html

Re: Want to know if a feature is available or not

Posted by Rohit Cha <rk...@gmail.com>.
How to maintain a cache and do such thing is there any sample code or
resource

On Mon, Oct 26, 2015 at 10:37 PM, David North <dt...@corefiling.co.uk>
wrote:

> That's correct. You need to iterate through each merged region in turn
> and see if your cell is in it. Unfortunately the way Excel stores the
> information means you can't easily get from a cell to "is this part of a
> merged region?". If you're reading a spreadsheet in and not altering it,
> you might choose to build up and maintain a cache to avoid having to
> loop every time you ask the question about a cell.
>
> David
>
> On 26/10/15 16:21, Blake Watson wrote:
> > I haven't done this but it seems to me that you would get the merged
> > regions from the sheet (getMergedRegion) and then check each one to see
> if
> > the cell was in that region.
> >
> > On Mon, Oct 26, 2015 at 3:54 AM, Rohit Cha <rk...@gmail.com>
> wrote:
> >
> >> Hi,
> >>
> >>      I am having an Excel-File containing both normal cells and Merged
> >> Cells I am working on getting data of the Excel File,so i want to know
> if
> >> there is any feature such that on giving a specific cell that will tell
> me
> >> weather the cell is a merged cell or not and if the cell is a merged
> cell
> >> give me the value of first row,colon of the cell(i mean merged cell
> value)
> >>
> >>           ThankYou
> >>
> >
> >
>
>
> --
> David North, Technical Lead, CoreFiling Limited
> http://www.corefiling.com
> Phone: +44-1865-203192
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Want to know if a feature is available or not

Posted by David North <dt...@corefiling.co.uk>.
That's correct. You need to iterate through each merged region in turn
and see if your cell is in it. Unfortunately the way Excel stores the
information means you can't easily get from a cell to "is this part of a
merged region?". If you're reading a spreadsheet in and not altering it,
you might choose to build up and maintain a cache to avoid having to
loop every time you ask the question about a cell.

David

On 26/10/15 16:21, Blake Watson wrote:
> I haven't done this but it seems to me that you would get the merged
> regions from the sheet (getMergedRegion) and then check each one to see if
> the cell was in that region.
>
> On Mon, Oct 26, 2015 at 3:54 AM, Rohit Cha <rk...@gmail.com> wrote:
>
>> Hi,
>>
>>      I am having an Excel-File containing both normal cells and Merged
>> Cells I am working on getting data of the Excel File,so i want to know if
>> there is any feature such that on giving a specific cell that will tell me
>> weather the cell is a merged cell or not and if the cell is a merged cell
>> give me the value of first row,colon of the cell(i mean merged cell value)
>>
>>           ThankYou
>>
>
>


-- 
David North, Technical Lead, CoreFiling Limited
http://www.corefiling.com
Phone: +44-1865-203192


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


Re: Want to know if a feature is available or not

Posted by Blake Watson <bl...@pnmac.com>.
I haven't done this but it seems to me that you would get the merged
regions from the sheet (getMergedRegion) and then check each one to see if
the cell was in that region.

On Mon, Oct 26, 2015 at 3:54 AM, Rohit Cha <rk...@gmail.com> wrote:

> Hi,
>
>      I am having an Excel-File containing both normal cells and Merged
> Cells I am working on getting data of the Excel File,so i want to know if
> there is any feature such that on giving a specific cell that will tell me
> weather the cell is a merged cell or not and if the cell is a merged cell
> give me the value of first row,colon of the cell(i mean merged cell value)
>
>           ThankYou
>



-- 

*Blake Watson*

*PNMAC*
Application Development Manager
5898 Condor Drive
Moorpark, CA 93021
(805) 330.4911 x7742
blake.watson@pnmac.com <me...@pnmac.com>
www.PennyMacUSA.com <http://www.pennymacusa.com/>