Dar formato con Spreadsheet::WriteExcel
![Nota Nota](https://perlenespanol.com/foro/styles/prosilver/imageset/icon_post_target.gif)
Gente: estoy intentando dar formato a un archivo Excel creado por el Perl con ayuda del modulo Spreadsheet::WriteExcel.
En la información que aparece en CPAN figura lo que pongo debajo; por ejemplo, para ponerle bordes... pero me interesa saber si alguno le pasó esto de querer dar formato... o tiene algún ejemplo... ya que la idea es recuadrar ciertas variable que van entrando en Excel...
Acá va el famoso ejemplo del cual estoy partiendo y no sé dónde ponerle el set border.
En la información que aparece en CPAN figura lo que pongo debajo; por ejemplo, para ponerle bordes... pero me interesa saber si alguno le pasó esto de querer dar formato... o tiene algún ejemplo... ya que la idea es recuadrar ciertas variable que van entrando en Excel...
Acá va el famoso ejemplo del cual estoy partiendo y no sé dónde ponerle el set border.
Using perl Syntax Highlighting
# EXCEL spreadsheet
use Spreadsheet::Write;
use Spreadsheet::WriteExcel;
my $sp=Spreadsheet::Write->new(
file => 'c:\perl\employees.xls',
styles => {
header => { font_weight => 'bold' },
},
);
$sp->addrow(
{ content => 'IDInstalacion', font_weight => 'bold' },
{ content => 'Last Name', font_weight => 'bold' },
{ content => 'Age', style => 'header' },
);
$sp->addrow("John","Doe",34);
$sp->addrow("Susan","Smith",28);
use Spreadsheet::Write;
use Spreadsheet::WriteExcel;
my $sp=Spreadsheet::Write->new(
file => 'c:\perl\employees.xls',
styles => {
header => { font_weight => 'bold' },
},
);
$sp->addrow(
{ content => 'IDInstalacion', font_weight => 'bold' },
{ content => 'Last Name', font_weight => 'bold' },
{ content => 'Age', style => 'header' },
);
$sp->addrow("John","Doe",34);
$sp->addrow("Susan","Smith",28);
Coloreado en 0.004 segundos, usando GeSHi 1.0.8.4
Using text Syntax Highlighting
set_border()
Also applies to: set_bottom()
set_top()
set_left()
set_right()
Default state: Border is off
Default action: Set border type 1
Valid args: 0-13, See below.
A cell border is comprised of a border on the bottom, top, left and right. These can be set to the same value using set_border() or individually using the relevant method calls shown above.
The following shows the border styles sorted by Spreadsheet::WriteExcel index number:
Index Name Weight Style
===== ============= ====== ===========
0 None 0
1 Continuous 1 -----------
2 Continuous 2 -----------
3 Dash 1 - - - - - -
4 Dot 1 . . . . . .
5 Continuous 3 -----------
6 Double 3 ===========
7 Continuous 0 -----------
8 Dash 2 - - - - - -
9 Dash Dot 1 - . - . - .
10 Dash Dot 2 - . - . - .
11 Dash Dot Dot 1 - . . - . .
12 Dash Dot Dot 2 - . . - . .
13 SlantDash Dot 2 / - . / - .
Also applies to: set_bottom()
set_top()
set_left()
set_right()
Default state: Border is off
Default action: Set border type 1
Valid args: 0-13, See below.
A cell border is comprised of a border on the bottom, top, left and right. These can be set to the same value using set_border() or individually using the relevant method calls shown above.
The following shows the border styles sorted by Spreadsheet::WriteExcel index number:
Index Name Weight Style
===== ============= ====== ===========
0 None 0
1 Continuous 1 -----------
2 Continuous 2 -----------
3 Dash 1 - - - - - -
4 Dot 1 . . . . . .
5 Continuous 3 -----------
6 Double 3 ===========
7 Continuous 0 -----------
8 Dash 2 - - - - - -
9 Dash Dot 1 - . - . - .
10 Dash Dot 2 - . - . - .
11 Dash Dot Dot 1 - . . - . .
12 Dash Dot Dot 2 - . . - . .
13 SlantDash Dot 2 / - . / - .
Coloreado en 0.000 segundos, usando GeSHi 1.0.8.4