sample.pl untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 45 CC 5 SCAR 30.9
CC
5
Cov
0%
handler
30.0
BEGIN
2.0
BEGIN
2.0
CRAP 22.0
1 use DBI;
2 use DBI::Dump;
3
4 my $dbh = DBI->connect(...);
5
6 my $sth = $dbh->prepare("select * from users");
7
8 $sth->execute();
9
10 my $exceldb = DBIx::Dump->new();
11
12 $exceldb->dump('format' => 'excel', 'output' => 'db2.xls', 'sth' => $sth,
13 'eventHandler' => \&handler);
14
15 my $count = 0;
16 sub handler
17 {
18 my ($self, $data, $colName, $row) = @_;
19
20 my $format;
21 if ($count == 0)
22 {
23 $format = $self->{Generator}->addformat(); # Add a format
24 $format->set_bold();
25 $format->set_color('red');
26 $format->set_align('center');
27 $self->{excelFormat} = $format;
28 }
29 $count++;
30
31 if ($row == 2)
32 {
33 $self->{excelFormat} = undef;
34 $format = $self->{Generator}->addformat(); # Add a format
35 $format->set_num_format(0x0f);
36 }
37
38 if ($row > 1 && $colName == 'ACQUISITION DATE')
39 {
40 $self->{excelFormat} = $format;
41 }
42 elsif ($row > 1)
43 {
44 $self->{excelFormat} = undef;
45 }
46 }
47