line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Business::ReportWriter::OOCalc; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
22640
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
923
|
use POSIX qw(setlocale LC_NUMERIC); |
|
1
|
|
|
|
|
19163
|
|
|
1
|
|
|
|
|
12
|
|
5
|
1
|
|
|
1
|
|
2451
|
use utf8; |
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
1634
|
use OpenOffice::OOCBuilder; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use base 'Business::ReportWriter'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub begin_line { |
11
|
|
|
|
|
|
|
my ( $self, $rec ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$self->{rownr}++; |
14
|
|
|
|
|
|
|
$self->{fieldnr} = 0; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub out_field { |
18
|
|
|
|
|
|
|
my ( $self, $text, $field ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$self->{fieldnr}++; |
21
|
|
|
|
|
|
|
$self->out_text($text); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub begin_list { |
25
|
|
|
|
|
|
|
my ($self) = @_; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $sheet = OpenOffice::OOCBuilder->new(); |
28
|
|
|
|
|
|
|
$self->{sheet} = $sheet; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub print_doc { |
32
|
|
|
|
|
|
|
my ( $self, $filename ) = @_; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $sheet = $self->{sheet}; |
35
|
|
|
|
|
|
|
if ($filename) { |
36
|
|
|
|
|
|
|
$sheet->generate($filename); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub out_text { |
41
|
|
|
|
|
|
|
my ( $self, $text ) = @_; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
my $sheet = $self->{sheet}; |
44
|
|
|
|
|
|
|
$sheet->goto_xy( $self->{fieldnr}, $self->{rownr} ); |
45
|
|
|
|
|
|
|
utf8::decode($text); |
46
|
|
|
|
|
|
|
$sheet->set_data($text); |
47
|
|
|
|
|
|
|
print "$self->{rownr} $self->{fieldnr}: $text\n"; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
__END__ |