Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Adding Borders to Cells using Excel::Writer::XLSX

by GuiPerl (Acolyte)
on Jul 07, 2014 at 17:14 UTC ( #1092612=note: print w/replies, xml ) Need Help??


in reply to Re: Adding Borders to Cells using Excel::Writer::XLSX
in thread Adding Borders to Cells using Excel::Writer::XLSX

I had to change coding. This little example will work:
use strict; use warnings; use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( "Cell_Borders.xlsx" ); my $worksheet = $workbook->add_worksheet(); my $textbox1 ="Hello World!"; my $format_box = $workbook->add_format(); $format_box->set_top('5'); $format_box->set_bottom('5'); $worksheet->merge_range( 'A8:B8', "$textbox1", $format_box );
This will add a border on the top and bottom cell.

To fix the problem, I had to add the formatting calls individual (i.e. $format_box->set_top()) and not the to add_format() method.

Replies are listed 'Best First'.
Re^3: Adding Borders to Cells using Excel::Writer::XLSX
by poj (Abbot) on Jul 07, 2014 at 17:23 UTC
    set_border(), set_top(), etc are FORMAT methods not WORKSHEET or WORKBOOK methods.
    #!perl use strict; use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( 'borders.xlsx' ); my $worksheet = $workbook->add_worksheet(); my $fmt_top = $workbook->add_format(); $fmt_top->set_top(); $worksheet->set_column( 'A:B', 30, $fmt_top );
    see Excel::Writer::XLSX
    poj

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1092612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2020-02-20 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (86 votes). Check out past polls.

    Notices?