I did it.

Thanks for responding.

I will get back to you if I face any problem.


Thanks a lot.

Regards,
Deepak


-----Original Message-----
From: Murphy, Mark [mailto:[email protected]] 
Sent: Tuesday, November 15, 2016 12:12 AM
To: 'POI Users List' <[email protected]>
Subject: RE: XSSF for XLS usinh multimap

Show us code, what did you try, and what happened?

-----Original Message-----
From: Tripathi, Shiv Deepak [mailto:[email protected]]
Sent: Monday, November 14, 2016 1:06 PM
To: POI Users List <[email protected]>
Subject: RE: XSSF for XLS usinh multimap

Hi ,

As I said I am having these values in multimap

{Deepak=[[[[F1, F4]]]], Ajinkya=[[[[F2, F5]]]]} And want to read a existing 
excel file and replace the value available in F1 and F4 with Deepak.

So I need to read the excel too.

I tried some ways In java , but got stucked.



-----Original Message-----
From: Javen O'Neal [mailto:[email protected]]
Sent: Monday, November 14, 2016 12:00 PM
To: POI Users List <[email protected]>
Subject: Re: XSSF for XLS usinh multimap

Is this a question about how to iterate over a multimap or how to set a cell 
value in POI?

Read the javadocs for the multimap implementation you are using.
For example, org.apache.commons.collections4.MultiValuedMap is here:
https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/MultiValuedMap.html

Read the POI HSSF and XSSF quick guide to learn how to set a cell value as a 
string.
https://poi.apache.org/spreadsheet/quick-guide.html#Creating+Cells


The pseudo-code/python answer:

# Getting a Cell object at a CellAddress addr on a Sheet sheet def 
getCell(sheet, addr):
    r = addr.getRow()
    c = addr.getColumn()
    # create row if it does not exist
    row = sheet.getRow(r) or sheet.createRow(r)
    cell = row.getCell(c) or row.createCell(c)
    return cell

# Iterating over a multi-map
for name, addresses in amultimap.items():
    for addr in addresses:
        getCell(sheet, addr).setCellValue(name)
       


On 11/13/16 10:34, Tripathi, Shiv Deepak wrote:
> Hi All,
>
>
> I have a multimap:
>
> {Deepak=[[[[F1, F4]]]], Ajinkya=[[[[F2, F5]]]]}
>
> In this F1,F4 are nothing but cell Adress.
>
>
> I want to write These values in given cell number like:
>
> F1 and F4 should have Deepak as value.
>
> Can you please let me know how can I write it.
>
> I am using XSSF.
>
> Thanks in advance.
>
>
> Regards,
> Deepak
>
> ________________________________
> The information contained in this message may be confidential and legally 
> protected under applicable law. The message is intended solely for the 
> addressee(s). If you are not the intended recipient, you are hereby notified 
> that any use, forwarding, dissemination, or reproduction of this message is 
> strictly prohibited and may be unlawful. If you are not the intended 
> recipient, please contact the sender by return e-mail and destroy all copies 
> of the original message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected] For additional 
> commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional 
commands, e-mail: [email protected]

Reply via email to