Posted on 2009-04-12 06:47:06-07 by smc
Use setHyperlink to set cell value in spreadsheet.
I'd like to define a hyperlink in a spreadsheet cell.

Using the text2table example, I tried
for (my $j = 0 ; $j < $columns && @cellvalues ; $j++) { #$doc->cellValue($cells[$j], shift @cellvalues); $doc->setHyperlink($cells[$j], "CPAN", "http://www.cpan.org"); } }
which I thought might fill every cell, but to no avail.

I also tried this:

for (my $j = 0 ; $j < $columns && @cellvalues ; $j++) { #$doc->cellValue($cells[$j], shift @cellvalues); my @CellPara = $doc->getCellParagraphs($cells[$j]); $doc->setHyperlink($CellPara[0], "CPAN", "http://www.cpan.org"); } }
without success.

I also tried

$doc->setHyperlink($sheet, 'B2', "CPAN", "http://www.cpan.org");
but am still going nowhere fast. No sign of CPAN is showing up in the content.xml data file.

Any suggestions? Thanks.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.