I wasn't too happy to keep track of indices, so I thought about it some more and was able to make a different solution.
Basically, always create a new cell style and copy the settings from the current to the new one. Then apply the desired new border setting to the new style, then apply the new cell style onto the cell. In my arrogant ignorance of the number of allowable cell styles, this could be a problem. One can get the current state of the borders by using the getBorderTop (...Bottom, ...Left, etc) methods on HSSFCellStyle. The values are constants in HSSFCellStyle (BORDER_THIN, etc). You should be able to see if a border is set that way, and clear it by setting it to BORDER_NONE. Regards, KaJun On Thu, 26 Oct 2006 20:49:33 -0700, "Stoicescu, Adriana" <[EMAIL PROTECTED]> said: > I know it does not help you, but I want you to know that I applied the > same solution. I could not find another one, like removing the border > after I no longer need it. > Adriana > > -----Original Message----- > From: KaJun Cheng [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 26, 2006 3:35 PM > To: [email protected] > Subject: adding additional borders to a cell > > Hi, > > I am trying to add borders to a cell that might already have a border > set. For instance, I might want to add a top border to a cell that > already has a left border set. > > It seemed to me that I should just do getCellStyle() from a cell and set > it's border. However, calling this for the first time on a cell has the > effect of setting the border on all cells. It seems to be setting the > style on a predefined, global cell style. > > I thought I could keep track of all the indices of all the cell styles I > create, and use the cell style getIndex() method to make sure I'm adding > to one of my cell styles instead of a default one, but I thought there > may be a better solution to do what I want so I post the question > here... does anyone have a recommendation on how to achieve what I want > to do? > > I googled the mailing list archives (adding > "site:mail-archives.apache.org/mod_mbox/jakarta-poi-user/" to the search > terms) but I didn't notice anything helpful for my situation... > > Thanks in advance, > KaJun > > > > > -- > http://www.fastmail.fm - One of many happy users: > http://www.fastmail.fm/docs/quotes.html > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > Mailing List: http://jakarta.apache.org/site/mail2.html#poi > The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ > > ------------------------------------------------------------------------------------- > Email Confidentiality Notice and Disclaimer > > This email message contains information which may be confidential and > or legally privileged. Unless you are the intended recipient (or have > been authorised to receive on behalf of the intended recipient), you > may not use, copy or disclose to anyone the message or any information > contained in the message or from any attachments that were sent with > this email. If you have received this email message in error, please > advise the sender by email, and delete the message. > > All business and transactions of whatsoever nature be it as agent or > as principal with any party whatsoever shall solely be conducted in > accordance with our Standard Trading Conditions. These conditions have > clauses that may limit our liability. A copy of our Standard Terms is > available on request. When an air waybill or bill of lading or any > other international consignment note is issued, the conditions that > apply for such a document will be in addition to our Standard Trading > Conditions, and for the relative air or sea or other mode of transport > leg / movement only, they will be paramount. > ------------------------------------------------------------------------------------- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > Mailing List: http://jakarta.apache.org/site/mail2.html#poi > The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ > -- http://www.fastmail.fm - Choose from over 50 domains or use your own --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
