poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hissink Muller <mar...@gmail.com>
Subject Adding Hyperlink support to POI-HSSF...?
Date Sat, 19 Feb 2005 08:31:48 GMT
LS, 

Kindly I would like to ask your thoughts on adding support for cells
with a hyperlink to POI-HSSF. I've been looking into the component and
I've learned the following:

	- At first, the RecordFactory is initialized [1] loading all the
Record-classes that are available for the Excel-fileformat and
classifying by their sid.
	- When an Excel-file is read; the InputStream is processed [2] and
Record-elements are created from the stream that is read.
	- In a later stage Workbook(s)[3], HSSFSheet(s)[4], HSSFRow(s)[5] and
HSSFCell(s)[6] are created from the List of Record(s).
	- Zooming in on the creation of an HSSFCell; the type is determined
from the 'CellValueRecordInterface cval' [7] where either a
CELL_TYPE_STRING, CELL_TYPE_NUMERIC, etc. is assigned as
cellType-attribute.
	
Currently, CELL_TYPE_HYPERLINK is not a known cellType, but instead a
cell containing an hyperlink is merely recognized as a
CELL_TYPE_STRING with the the label as it's stringValue. The URL
itself is discarded, so it seems. To be able to add support for the
Hyperlink, I reckon that I need to answer the following questions:

	1. What is the sid for a Record which indicates an Excel-cell which
contains the Hyperlink?
	2. How is the Hyperlink correctly read and turned into a proposed
Hyperlink when parsing?

When printing the list of records that are read for a simple
example-worksheet with one URL in Cell A1, I see several
UnknownRecord(s); 448, 239, 440, 239 and 239. Judging by the
recordSize; I would say 440 is my best/only bet with a recordSize of
108. All others have recordSizes 4 (sid 448) or 10 (sid 239).

Do my investigation and questions align with your ideas? Can anyone
confirm that sid 440 is the one to investigate? Do you have any other
suggestions?

Thanks for your thoughts. 

Regards,
- Mark


[1] - org.apache.poi.hssf.record.RecordFactory{ ... private static Map
          recordsMap  = recordsToMap(records); ... }
[2] - org.apache.poi.hssf.usermodel.HSSFWorkbook { ... List records =
RecordFactory.createRecords(stream); ... }
[3] - org.apache.poi.hssf.usermodel.HSSFWorkbook { ... workbook =
Workbook.createWorkbook(records); ... }
[4] - org.apache.poi.hssf.usermodel.HSSFWorkbook { ... HSSFSheet
hsheet = new HSSFSheet(workbook, sheet); ... }
[5] - org.apache.poi.hssf.usermodel.HSSFSheet { ...
createRowFromRecord(row); ... }
[6] - org.apache.poi.hssf.usermodel.HSSFSheet { ... 
hrow.createCellFromRecord( cval ); ... }
[7] - orc.apache.poi.hssf.usermodel.HSSFCell { ... private int
determineType(CellValueRecordInterface cval) ... }

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Mime
View raw message