File: diag_border.pl

package info (click to toggle)
libspreadsheet-writeexcel-perl 2.40-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 2,768 kB
  • sloc: perl: 19,617; makefile: 14
file content (40 lines) | stat: -rw-r--r-- 1,082 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl -w

##############################################################################
#
# A simple formatting example that demonstrates how to add a diagonal cell
# border with Spreadsheet::WriteExcel
#
# reverse(''), May 2004, John McNamara, jmcnamara@cpan.org
#

use strict;
use Spreadsheet::WriteExcel;


my $workbook  = Spreadsheet::WriteExcel->new('diag_border.xls');
my $worksheet = $workbook->add_worksheet();


my $format1   = $workbook->add_format(diag_type       => '1');

my $format2   = $workbook->add_format(diag_type       => '2');

my $format3   = $workbook->add_format(diag_type       => '3');

my $format4   = $workbook->add_format(
                                      diag_type       => '3',
                                      diag_border     => '7',
                                      diag_color      => 'red',
                                     );


$worksheet->write('B3',  'Text', $format1);
$worksheet->write('B6',  'Text', $format2);
$worksheet->write('B9',  'Text', $format3);
$worksheet->write('B12', 'Text', $format4);



__END__