You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Mark Hissink Muller <ma...@gmail.com> on 2005/02/20 21:14:34 UTC

Adding Hyperlink support to POI-HSSF...? (3)

POI-dev members,

Thanks again for your support on my attempt to add an Excel
Hyperlinked cell to HSSF.

Things are going fairly well. With help of Avik's document, I've been
able to read the label and the actual URL into a new HyperlinkRecord,
which works fine.

When testing the HyperlinkRecord-class fully integrated, and trying to
read the hyperlink from the modified HSSFCell, I have some problems.

Instead of finding my new HSSFCell.CELL_TYPE_HYPERLINK (with record
HyperlinkRecord), I find a LabelSSTRecord, which, as I understand it,
is a basic kind of text-record.

Zooming in on:

	public static Workbook createWorkbook(List recs)
	
I see that 161 Record(s) from the InputStream [1] are input but that
after 81 records the processing breaks because an EOFRecord is found.
Commenting the break, I learn that my HyperlinkRecord is number 101 in
the List. I am puzzled; why is the EOF found before all the records
are property processed?

Another thing which I could use a suggestion is the implementation of:

	public int serialize( int offset, byte[] data ) // and
	public int getRecordSize()

For your convenience, I've added my current (draft) version of the
HyperlinkRecord as an attachment to this mail.

Any thoughts are highly appreciated.

Cheers,
- Mark

[1] - I have a simple example where I try to read an Hyperlink+Label
from cell A1. Apart from this, the workbook is empty (new Excel-file)


Re: Adding Hyperlink support to POI-HSSF...? (3)

Posted by av...@itellix.com.
Hey, this looks cool...

But should HyperlinkRecord be a CellValueRecordInterface? When you read in the
file, what record do you get at the cell.. an SSTRecord? Maybe the HLINK is
only indirectly linked to the cell? You'll probably just have to pore over
BiffViewer output to understand the semantics of this.. that's the only 
way, as
Andy suggested earlier.

As far as implementing serialize, check our the other records... dont look at
SST, which is probably most complicated.. look at NumberRecord for simple,
Formula record for intermediate ..

Getsize... well, you will just have to count :) .. ie, add up the sizes of the
individual elements... and if you mess up the count, subsequent records will
not be read.. dont you just love the format :) !! Again, check formularecord
for a useful example.

HTH
-
Avik



Quoting Mark Hissink Muller <ma...@gmail.com>:

> I'm not sure the attachment worked; find the draft here:
>
> http://www.hissinkmuller.nl/poi/HyperlinkRecord.java
>
> Thanks,
> - Mark
>
>
> On Sun, 20 Feb 2005 21:14:34 +0100, Mark Hissink Muller
> <ma...@gmail.com> wrote:
>> POI-dev members,
>>
>> Thanks again for your support on my attempt to add an Excel
>> Hyperlinked cell to HSSF.
>>
>> Things are going fairly well. With help of Avik's document, I've been
>> able to read the label and the actual URL into a new HyperlinkRecord,
>> which works fine.
>>
>> When testing the HyperlinkRecord-class fully integrated, and trying to
>> read the hyperlink from the modified HSSFCell, I have some problems.
>>
>> Instead of finding my new HSSFCell.CELL_TYPE_HYPERLINK (with record
>> HyperlinkRecord), I find a LabelSSTRecord, which, as I understand it,
>> is a basic kind of text-record.
>>
>> Zooming in on:
>>
>>         public static Workbook createWorkbook(List recs)
>>
>> I see that 161 Record(s) from the InputStream [1] are input but that
>> after 81 records the processing breaks because an EOFRecord is found.
>> Commenting the break, I learn that my HyperlinkRecord is number 101 in
>> the List. I am puzzled; why is the EOF found before all the records
>> are property processed?
>>
>> Another thing which I could use a suggestion is the implementation of:
>>
>>         public int serialize( int offset, byte[] data ) // and
>>         public int getRecordSize()
>>
>> For your convenience, I've added my current (draft) version of the
>> HyperlinkRecord as an attachment to this mail.
>>
>> Any thoughts are highly appreciated.
>>
>> Cheers,
>> - Mark
>>
>> [1] - I have a simple example where I try to read an Hyperlink+Label
>> from cell A1. Apart from this, the workbook is empty (new Excel-file)
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
> Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta POI Project: http://jakarta.apache.org/poi/
>
>



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


Re: Adding Hyperlink support to POI-HSSF...? (3)

Posted by Mark Hissink Muller <ma...@gmail.com>.
I'm not sure the attachment worked; find the draft here:

http://www.hissinkmuller.nl/poi/HyperlinkRecord.java

Thanks,
- Mark


On Sun, 20 Feb 2005 21:14:34 +0100, Mark Hissink Muller
<ma...@gmail.com> wrote:
> POI-dev members,
> 
> Thanks again for your support on my attempt to add an Excel
> Hyperlinked cell to HSSF.
> 
> Things are going fairly well. With help of Avik's document, I've been
> able to read the label and the actual URL into a new HyperlinkRecord,
> which works fine.
> 
> When testing the HyperlinkRecord-class fully integrated, and trying to
> read the hyperlink from the modified HSSFCell, I have some problems.
> 
> Instead of finding my new HSSFCell.CELL_TYPE_HYPERLINK (with record
> HyperlinkRecord), I find a LabelSSTRecord, which, as I understand it,
> is a basic kind of text-record.
> 
> Zooming in on:
> 
>         public static Workbook createWorkbook(List recs)
> 
> I see that 161 Record(s) from the InputStream [1] are input but that
> after 81 records the processing breaks because an EOFRecord is found.
> Commenting the break, I learn that my HyperlinkRecord is number 101 in
> the List. I am puzzled; why is the EOF found before all the records
> are property processed?
> 
> Another thing which I could use a suggestion is the implementation of:
> 
>         public int serialize( int offset, byte[] data ) // and
>         public int getRecordSize()
> 
> For your convenience, I've added my current (draft) version of the
> HyperlinkRecord as an attachment to this mail.
> 
> Any thoughts are highly appreciated.
> 
> Cheers,
> - Mark
> 
> [1] - I have a simple example where I try to read an Hyperlink+Label
> from cell A1. Apart from this, the workbook is empty (new Excel-file)
> 
> 
>

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