Hi James, I have done the same thing and I found a bug in
org.apache.poi.hssf.record.NameRecord class. the method getIndexToSheet()
says:
return ld_5_index_to_sheet;
and it shoud say:
return field_6_equals_to_index_to_sheet;
doing this change I was able to make a template with this option set, read
it using POI and rewrite it without losing the option.
Now, If you want to set this option from scratch, without having a template,
you need to implement new methods. The record resulting of the BiffViewer
that represent this option is:
============================================
Offset 0x55b (1371)
recordid = 0x18, size =27
[NAME]
.option flags = 0020
.keyboard shortcut = 00
.length of the name = 1
.size of the formula data = 11
.unused = 0
.( 0 = Global name, otherwise index to sheet (one-based) ) = 1
.Length of menu text (character count) = 0
.Length of description text (character count) = 0
.Length of help topic text (character count) = 0
.Length of status bar text (character count) = 0
.Name (Unicode flag) = 0
.Name (Unicode text) = Print_Titles
.Formula data (RPN token array without size field) = [3B, 00, 00,
00, 00, 00, 00, 00, 00, FF, 00, ]
.Menu text (Unicode string without length field) = null
.Description text (Unicode string without length field) = null
.Help topic text (Unicode string without length field) = null
.Status bar text (Unicode string without length field) = null
[/NAME]
if the line "( 0 = Global name, otherwise index to sheet (one-based) )" is
1, the row repeating option is set, if is 0, it is not.
The line "Formula data (RPN token array without size field)" represents the
row and column to be repeated. (In this case row 1)
Now, you can create this record using the method createName of the
HSSFWorkbook class, but this method returns a HSSFName class empty, so you
have to implement a new method with a NameRecord parameter to create a
HSSFName with the values of the attributes you need.
What I don�t know yet is the way the row and column is represented in the
line "Formula data (RPN token array without size field)" .
Well, I hope this helps.
Christian Del Mar
-----Mensaje original-----
De: James Deerkoski [mailto:jdeerkoski@;caci.com]
Enviado el: Monday, November 04, 2002 7:25 PM
Para: Christian Del Mar Zarate
Asunto: Repeating Rows option in POI
Hello Christian,
I saw in the POI user groups that you are looking into setting repeating
rows in POI. I too am interested in this. I would like to contribute but am
a novice in this area.
I did do a "diff" using the results of a BiffViewer, and found that this
record was added when I add the "repeating rows" option:
============================================
Offset 0x584 (1412)
recordid = 0x18, size =27
[UNKNOWN RECORD]
.id = 18
[/UNKNWON RECORD]
-----UNKNOWN----------------------------------
00000000 20 00 00 01 0B 00 00 00 01 00 00 00 00 00 00 07 ...............
00000010 3B 00 00 00 00 01 00 00 00 FF 00 ;..........
-----UNKNOWN----------------------------------
============================================
How is your development going? If there is any way I can assist, let me know
******************
Jim Deerkoski
Programmer/Analyst
CACI, Inc., Chantilly, VA
(703) 679-4228
****************
Andrew C. Oliver wrote:
This feature has not yet been implemented. To implement it:
1. Optional (but recommended): Buy the Excel 97 Developer's Kit by Micrsoft
Press from Amazon.com (out of print, but cheap if bought used)
2. Create a blank sheet with ONLY enough data/etc to demonstrate the feature
you want to implement
3. Create a blank sheet that is identical minus that feature
4. run java org.apache.poi.hssf.dev.BiffViewer MySheet.xls >output.foo on
both (substituting other file names for input and redirect)
5. Run the UNIX diff command (or equivilent) on the redirected output and
compare
6. Create a unit test for testing the funcitonality
7. Create a low level implmenetation (including records and appropriate
changed to the model) o.a.c.p.hssf.model
8. Create high level api to manipulate the model
9. Update documentation
10. Follow the patch instructions here:
<http://jakarta.apache.org/poi/getinvolved/index.html>
http://jakarta.apache.org/poi/getinvolved/index.html
This conversation however is more appropraite for poi-dev list
-Andy
-----------------------------------------------------------------------
Este mensaje y los documentos, que en su caso, lleve anexos, pueden
contener informacion confidencial y ata�e exclusivamente a las personas
a las que va dirigido. Cualquier opinion en el contenida, es exclusiva de
su autor y no representa necesariamente la opinion de AZERTIA.
Si usted no es el destinatario de este mensaje, considerese advertido de
que lo ha recibido por error y que cualquier uso, difusion o copia estan
prohibidos legalmente. Si ha recibido este mensaje por error, le rogamos
que nos lo comunique por la misma via o al telefono 93 207 55 11 y proceda
a destruirlo inmediatamente.
This email is confidential and intended solely for the use of the individual
to whom it is addressed. Any views or opinions presented are solely those
of the author and do not necessarily represent those of AZERTIA.
If you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, forwarding, printing,
or copying of this email is strictly prohibited.
If you have received this email in error please notify it to AZERTIA
by telephone on number +34 93 207 55 11.
-----------------------------------------------------------------------
--
To unsubscribe, e-mail: <mailto:poi-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:poi-user-help@;jakarta.apache.org>