CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Spreadsheet::WriteExcel - Need help with write_url() function

 



terrykhatri531
User

Jul 29, 2014, 6:24 AM

Post #1 of 5 (399 views)
Spreadsheet::WriteExcel - Need help with write_url() function Can't Post

Hi,

I am trying to create links to the internal worksheet and I have 2 problems with that:



No.1 - Links are not working, meaning when clicked does not take you to that worksheet giving error "Cannot open the specified file"

No.2 - I want the links to show just the worksheet names not the URL itself.



I have attached a picture to show you how it looks.



Here is the related code snippet :


Code
 
while ($a = $sth->fetchrow_hashref()) {
$worksheet->write_url($row,0, qq({internal:'$a->{OrderID}'!A1}), $link_format );
$worksheet->write($row,1, $a->{OrderID}, $bold);
$worksheet->write($row,2, $a->{OrderDate});


......................


Many many thanks !!

Terry
Attachments: Excel.png (28.4 KB)


FishMonger
Veteran / Moderator

Jul 29, 2014, 7:35 AM

Post #2 of 5 (396 views)
Re: [terrykhatri531] Spreadsheet::WriteExcel - Need help with write_url() function [In reply to] Can't Post

Try changing:

Code
$worksheet->write_url($row,0,  qq({internal:'$a->{OrderID}'!A1}), $link_format );


To:

Code
$worksheet->write_url($row,0,  qq(internal:'$a->{OrderID}'!A1), $link_format );


Also, DON'T use $a for the hash ref. $a and $b are special global vars used in sort routines and it's poor practice to use them outside of of that context.


terrykhatri531
User

Jul 30, 2014, 7:03 AM

Post #3 of 5 (378 views)
Re: [FishMonger] Spreadsheet::WriteExcel - Need help with write_url() function [In reply to] Can't Post

Thanks Ron,

Ok when I click on the link I get LibreOffice warning saying "For security reasons the hyperlink cannot be executed. The stated address will not be opened".

I did google around to find a way to turn off security or lower it but could not find anything, do you know how I can do that.

Many thanks !!

Terry


terrykhatri531
User

Jul 30, 2014, 4:12 PM

Post #4 of 5 (316 views)
Re: [terrykhatri531] Spreadsheet::WriteExcel - Need help with write_url() function [In reply to] Can't Post

Hi,

Ok I have posted this question to LibreOffice Forum


(This post was edited by terrykhatri531 on Jul 30, 2014, 4:25 PM)


terrykhatri531
User

Jul 31, 2014, 12:43 AM

Post #5 of 5 (309 views)
Re: [terrykhatri531] Spreadsheet::WriteExcel - Need help with write_url() function [In reply to] Can't Post

Hi,

Just for a reference for other people who may be looking for a solution for a situation as I have had, the following code works :


Code
 
my $url = qq(internal:$a->{OrderID}!A1);
my $string = qq('$a->{OrderID}');

$worksheet->write($row,0,$url,$string,$link_format);


Many thanks for all your help !!

Terry

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives