× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks for the "how-i'd-do-this" Buck, helpful!

<snip>
I myself find it easiest to look at the Javadoc for POI
http://poi.apache.org/apidocs/index.html and work from there to see how
a Java programmer would do task x.

In this case, we're looking to get a cell's style attributes. So I'd
start looking at the class Cell.
http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Cell.html One
of the methods in Cell is getCellStyle(). Scott implemented that as
either one of SSCell_getCellStyle or HSSFCell_getCellStyle.

It's important to remember that cell styles aren't really a property of
the cell per se; rather they are defined at the workbook level. That
means the new spreadsheet will need to replicate the cell style 'table'
before the program can apply a given style to the cells in that new
spreadsheet.

To find out how to do that, start at Workbook
http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Workbook.html
That class has several style methods:
getNumCellStyles()
getCellStyleAt()
createCellStyle()

You may be more interested to try Workbook.cloneSheet(), then delete all
the rows and populate it yourself. I haven't tried to see if the
existing style table comes along with the cloned copy.

Very often, when I'm trying to implement something new from POI, I'll
write it up in Java and test it there. There are a lot more examples in
Java than in RPG :-) Once the Java code is working, I'll know exactly
what new things I need to prototype for RPG. I put those new prototypes
in a separate source member to make future maintenance of HSSFR4 easier.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.