Thank you, Mark.
Is there anyone else out there who could mention any more on this?
Z.
----- Original Message -----
From: "MSB" <[email protected]>
To: <[email protected]>
Sent: Thursday, October 01, 2009 5:16 PM
Subject: Re: Questions about HSSF and HWPF
Question 1:
Must admit that I have never thought about cut/copy/paste operations
before
using POI as these always seem to me to be user directed operations - by
this, I mean using Excel to view the worksheet, deciding upon which cells
to
cut/copy/paste and doing just that with the application. So, I cannot
begin
to say how I would go about this task without playing with some code
myself.
Guessing, I would say that cutting would simply mean manually removing the
cells in the range from the worksheet, copying/pasting would mean
mannually
inserting copies of the cells in the range into the worksheet. Finally,
with
regard to the indices, I do not know the answer but would assume zero is
the
first, not one - sheets start at zero as do rows, cells etc.
Question 2:
HWPF is not a mature API - it is largely the work of a developer who had
to
cease working on the API for legal reasons after securing a new job - and
there is lots that it cannot currently do. It is almost certainly the case
that the code exists to read the font information from the document but
that
the work was not completed to expose that information to the user. This
means that there is a wonderful opportunity to get involved in developing
the API if you have the time/inclination. The integer values indicate the
font that the text should be set to in the list of fonts that the Word
document file 'contains' so to speak but there is sadly not yet a way - at
least not one that I know of - to say 'get me the index for the Arial font
in this document and set this piece of text to that font'.
One final note of warning, I was working with HWPF - and this is I admit
prior to version 3.5 Final being released - and found that I could only
set
one 'treatment' for the text. Emboldening the text was fine on it's own as
was setting the colour of the text, but if I tried to both set the colour
of
the text and make it bold then the API threw an exception. As I have said,
the API needs to be developed further but the basics are - at least in my
opinion and for what that is worth - already in place and even with the
emergence of the xml based file formats there are enough binary Word
documents to make the effort worth while IMO.
If you have the option to do so, it would be better - IMO - to target the
xml based file format using XWPF; this has been the target of a more
consistent development effort for the reason I outlined above.
Yours
Mark B
Zachary Mitchell, BCIS wrote:
//=====================================================================
//QUESTION1:
- How do I use CellRangeAddress objects to copy/cut and paste
an area of cells from an HSSFSheet to another?
removeMergedRegion(int index); //cut
getMergedRegion(int index); //copy
in HSSFSheet,
Using these in fonjuction with CellRangeAddress?
I believe I understand what to do,
but the api documentation for these POI classesdoesn't tell me
what the above int indexes should be?
Do I assume they start from 1?
//=====================================================================
//QUESTION2:
When using HWPF to read and write from a Microsoft Word doc file,
there are methods in the CharacterRun class that let me get the Font
and FontSize for that particular CharacterRun.
How do I set Font values? What do the functions/arguments
void setFtcAscii(int ftcAscii)
void setFtcFE(int ftcFE)
void setFtcOther(int ftcOther)
do in terms of specifying a particular Font for a CharacterRun?
What values correspond to which Font?
Where may one get a list of the available Fonts, out of the HWPF classes?
//=====================================================================
--
View this message in context:
http://www.nabble.com/Questions-about-HSSF-and-HWPF-tp25690853p25693458.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
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]