poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Frans.Fli...@INGBank.com>
Subject RE: Adding Hyperlink support to POI-HSSF...?
Date Mon, 21 Feb 2005 10:46:11 GMT
Hi Mark,

It seems to me a hyperlinked cell would not be a different cell type. I
assume hyperlinks can be added to any existing type of cell (string,
numeric, etc.). Therefore it would seem to be an extra attribute for the
cell, not a new CELL_TYPE.

You'd probably get more input on the developer mailing list, by the way
(poi-dev@jakarta.apache.org). 

Good luck,
Frans


> -----Original Message-----
> From: Mark Hissink Muller [mailto:markhm@gmail.com]
> Sent: Saturday, February 19, 2005 9:32 AM
> To: poi-user@jakarta.apache.org
> Subject: Adding Hyperlink support to POI-HSSF...?
> 
> 
> 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/
> 


-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message