| 1 | # perl | ||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||
| 3 | # Class Report::Porf::HtmlReportConfigurator | ||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||
| 5 | # Perl Open Report Framework (Porf) | ||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||
| 7 | # Configures a Report::Porf::Table::Simple to write out HTML tables | ||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||
| 9 | # Ralf Peine, Tue May 27 11:29:32 2014 | ||||||||||||||||||||||||||||
| 10 | # | ||||||||||||||||||||||||||||
| 11 | # More documentation at the end of file | ||||||||||||||||||||||||||||
| 12 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 1 | $VERSION = "2.001"; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 17 | # | ||||||||||||||||||||||||||||
| 18 | # Example list with 10 lines (html) | ||||||||||||||||||||||||||||
| 19 | # | ||||||||||||||||||||||||||||
| 20 | # <html> | ||||||||||||||||||||||||||||
| 21 | # <table border='1' rules='groups'> | ||||||||||||||||||||||||||||
| 22 | # | ||||||||||||||||||||||||||||
| 23 | # <thead> | ||||||||||||||||||||||||||||
| 24 | # <tr><th>Coun</th><th>TimeStamp </th><th>Age </th><th>Prename </th><th>Surname </th></tr> | ||||||||||||||||||||||||||||
| 25 | # </thead> | ||||||||||||||||||||||||||||
| 26 | # | ||||||||||||||||||||||||||||
| 27 | # <tr><td>1 </td><td>0.000433 </td><td>10 </td><td>Vorname 1 </td><td>Name 1 </td></tr> | ||||||||||||||||||||||||||||
| 28 | # <tr><td>2 </td><td>0.000638 </td><td>20 </td><td>Vorname 2 </td><td>Name 2 </td></tr> | ||||||||||||||||||||||||||||
| 29 | # <tr><td>3 </td><td>0.000781 </td><td>30 </td><td>Vorname 3 </td><td>Name 3 </td></tr> | ||||||||||||||||||||||||||||
| 30 | # <tr><td>4 </td><td>0.000922 </td><td>40 </td><td>Vorname 4 </td><td>Name 4 </td></tr> | ||||||||||||||||||||||||||||
| 31 | # <tr><td>5 </td><td>0.001062 </td><td>50 </td><td>Vorname 5 </td><td>Name 5 </td></tr> | ||||||||||||||||||||||||||||
| 32 | # <tr><td>6 </td><td>0.001203 </td><td>60 </td><td>Vorname 6 </td><td>Name 6 </td></tr> | ||||||||||||||||||||||||||||
| 33 | # <tr><td>7 </td><td>0.001346 </td><td>70 </td><td>Vorname 7 </td><td>Name 7 </td></tr> | ||||||||||||||||||||||||||||
| 34 | # <tr><td>8 </td><td>0.001486 </td><td>80 </td><td>Vorname 8 </td><td>Name 8 </td></tr> | ||||||||||||||||||||||||||||
| 35 | # <tr><td>9 </td><td>0.001631 </td><td>90 </td><td>Vorname 9 </td><td>Name 9 </td></tr> | ||||||||||||||||||||||||||||
| 36 | # <tr><td>10 </td><td>0.001773 </td><td>100 </td><td>Vorname 10 </td><td>Name 10 </td></tr> | ||||||||||||||||||||||||||||
| 37 | # | ||||||||||||||||||||||||||||
| 38 | # </table><p/> | ||||||||||||||||||||||||||||
| 39 | # # Time needed for export of 10 data lines: 0.002013 | ||||||||||||||||||||||||||||
| 40 | # | ||||||||||||||||||||||||||||
| 41 | # </html> | ||||||||||||||||||||||||||||
| 42 | # | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 45 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | #-------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 48 | # | ||||||||||||||||||||||||||||
| 49 | # Report::Porf::Table::Simple::HtmlReportConfigurator; | ||||||||||||||||||||||||||||
| 50 | # | ||||||||||||||||||||||||||||
| 51 | #-------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | package Report::Porf::Table::Simple::HtmlReportConfigurator; | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 1 | ▶ | use Report::Porf::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 58 | 1 | ▶ | use Report::Porf::Table::Simple; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | #-------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 61 | # | ||||||||||||||||||||||||||||
| 62 | # Creation / Filling Of Instances | ||||||||||||||||||||||||||||
| 63 | # | ||||||||||||||||||||||||||||
| 64 | #-------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | # --- create Instance ----------------- | ||||||||||||||||||||||||||||
| 67 | sub new | ||||||||||||||||||||||||||||
| 68 | 4 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 69 | 4 | my $caller = $_[0]; | |||||||||||||||||||||||||||
| 70 | 4 | ▶ | my $class = ref($caller) || $caller; | ||||||||||||||||||||||||||
|
Condition33%1/3
ref $caller || $caller
MC/DC0%0/2
ref $caller || $caller
ref $caller
$caller
Truth table33%1/3
A || B
A= ref $callerB= $caller
| |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | # let the class go | ||||||||||||||||||||||||||||
| 73 | 4 | my $self = {}; | |||||||||||||||||||||||||||
| 74 | 4 | bless $self, $class; | |||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 4 | $self->_init(); | |||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 4 | return $self; | |||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | # --- Init ------------------------------------------------------------------ | ||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 4 | ▶ | sub _init { | ||||||||||||||||||||||||||
|
Subroutine
_init: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 84 | 4 | my ($self # instance_ref | |||||||||||||||||||||||||||
| 85 | ) = @_; | ||||||||||||||||||||||||||||
| 86 | 4 | $self->{AlternateRowColors} = []; | |||||||||||||||||||||||||||
| 87 | 4 | $self->set_escape_special_chars_action(\&Report::Porf::Util::escape_html_special_chars); | |||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | # --- verbose --------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 1 | ▶ | sub set_verbose { | ||||||||||||||||||||||||||
|
Subroutine
set_verbose: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 93 | 1 | my ($self, # instance_ref | |||||||||||||||||||||||||||
| 94 | $value # value to set | ||||||||||||||||||||||||||||
| 95 | ) = @_; | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | 1 | $self->{verbose} = $value; | |||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | 0 | ▶ | sub get_verbose { | ||||||||||||||||||||||||||
|
Subroutine
get_verbose: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 101 | 0 | my ($self, # instance_ref | |||||||||||||||||||||||||||
| 102 | ) = @_; | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 0 | return $self->{verbose}; | |||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | # --- Text in op of table ------------------------------------------------------ | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 0 | ▶ | sub set_table_top_text { | ||||||||||||||||||||||||||
|
Subroutine
set_table_top_text: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 110 | 0 | my $self = shift; # instance_ref | |||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 0 | $self->{TableTopText} = shift; | |||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | 4 | ▶ | sub get_table_top_text { | ||||||||||||||||||||||||||
|
Subroutine
get_table_top_text: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 116 | 4 | my $self = shift; # instance_ref | |||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | 4 | return $self->{TableTopText}; | |||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||
| 120 | # --- Alternate Row Colors ------------------------------------------------------ | ||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | 3 | ▶ | sub set_alternate_row_colors { | ||||||||||||||||||||||||||
|
Subroutine
set_alternate_row_colors: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 123 | 3 | my $self = shift; # instance_ref | |||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | 3 | $self->{AlternateRowColors} = []; | |||||||||||||||||||||||||||
| 126 | 3 | push (@{$self->{AlternateRowColors}}, @_); | |||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | 4 | ▶ | sub get_alternate_row_colors { | ||||||||||||||||||||||||||
|
Subroutine
get_alternate_row_colors: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 130 | 4 | my ($self, # instance_ref | |||||||||||||||||||||||||||
| 131 | ) = @_; | ||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | 4 | return @{$self->{AlternateRowColors}}; | |||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | # --- escape special chars --------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | 4 | ▶ | sub set_escape_special_chars_action { | ||||||||||||||||||||||||||
|
Subroutine
set_escape_special_chars_action: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 139 | 4 | my ($self, # instance_ref | |||||||||||||||||||||||||||
| 140 | $value # value to set | ||||||||||||||||||||||||||||
| 141 | ) = @_; | ||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | 4 | $self->{escape_special_chars_action} = $value; | |||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | 17 | ▶ | sub get_escape_special_chars_action { | ||||||||||||||||||||||||||
|
Subroutine
get_escape_special_chars_action: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 147 | 17 | my ($self, # instance_ref | |||||||||||||||||||||||||||
| 148 | ) = @_; | ||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||
| 150 | 17 | return $self->{escape_special_chars_action}; | |||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | # --- Add Attribute bgColor ------------------------------------------------------ | ||||||||||||||||||||||||||||
| 154 | 0 | ▶ | sub add_background_color_attribute { | ||||||||||||||||||||||||||
|
Subroutine
add_background_color_attribute: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 155 | 0 | return add_optional_attribute('bgcolor', @_); | |||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||
| 158 | # --- Add Attribute ------------------------------------------------------ | ||||||||||||||||||||||||||||
| 159 | 0 | ▶ | sub add_optional_attribute { | ||||||||||||||||||||||||||
|
Subroutine
add_optional_attribute: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 160 | 0 | my $name = shift; | |||||||||||||||||||||||||||
| 161 | 0 | my $value_str = shift; | |||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | 0 | ▶ | return " $name=\"$value_str\"" if (defined $value_str && $value_str ne ''); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $value_str and $value_str ne ""
MC/DC0%0/2
defined $value_str and $value_str ne ""
defined $value_str
$value_str ne ""
Truth table0%0/3
A and B
A= defined $value_strB= $value_str ne ""
| |||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | 0 | return ''; | |||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | #-------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 168 | # | ||||||||||||||||||||||||||||
| 169 | # Configure formats | ||||||||||||||||||||||||||||
| 170 | # | ||||||||||||||||||||||||||||
| 171 | #-------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | # --- create new report and configure ------------------------------------------- | ||||||||||||||||||||||||||||
| 174 | 3 | ▶ | sub create_and_configure_report { | ||||||||||||||||||||||||||
|
Subroutine
create_and_configure_report: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 175 | 3 | my ($self # instance_ref | |||||||||||||||||||||||||||
| 176 | ) = @_; | ||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 3 | return $self->configure_report(Report::Porf::Table::Simple->new()); | |||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | # --- Configure Export For Html ------------------------------------------------ | ||||||||||||||||||||||||||||
| 182 | 4 | ▶ | sub configure_report { | ||||||||||||||||||||||||||
|
Subroutine
configure_report: called CC=4 SCAR=14.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 183 | 4 | my ($self, # instance_ref | |||||||||||||||||||||||||||
| 184 | $report2configure, # report to be configured | ||||||||||||||||||||||||||||
| 185 | ) = @_; | ||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||
| 187 | 4 | $report2configure->set_format('HTML'); | |||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||
| 189 | # $self->set_default_column_width (10); | ||||||||||||||||||||||||||||
| 190 | 4 | $report2configure->set_default_align ('Left'); | |||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | 4 | $report2configure->set_file_start("<html>\n"); | |||||||||||||||||||||||||||
| 193 | 4 | $report2configure->set_file_end ("</html>\n"); | |||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||
| 195 | 4 | my $tableTopText = $self->get_table_top_text(); | |||||||||||||||||||||||||||
| 196 | 4 | ▶ | $tableTopText = '' unless $tableTopText; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 197 | 4 | ▶ | $tableTopText = "<h2>$tableTopText</h2>\n" if $tableTopText; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | 4 | $report2configure->set_table_start("$tableTopText<table border='1' rules='all'>\n"); | |||||||||||||||||||||||||||
| 200 | 4 | $report2configure->set_table_end ("</table><p/>\n"); | |||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | 4 | my @row_colors = $self->get_alternate_row_colors(); | |||||||||||||||||||||||||||
| 203 | 4 | my $switch = -1; | |||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||
| 205 | 4 | ▶ | if ( scalar @row_colors) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 206 | 3 | $report2configure->set_table_start("$tableTopText<table border='1' rules='cols'>\n"); | |||||||||||||||||||||||||||
| 207 | $report2configure->set_row_start( | ||||||||||||||||||||||||||||
| 208 | sub | ||||||||||||||||||||||||||||
| 209 | 7 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 210 | 7 | $switch++; | |||||||||||||||||||||||||||
| 211 | 7 | ▶ | $switch = $[ if $switch >= scalar @row_colors; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 212 | 7 | return '<tr bgcolor="'.$row_colors[$switch].'">'; | |||||||||||||||||||||||||||
| 213 | 3 | }); | |||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||
| 215 | else { | ||||||||||||||||||||||||||||
| 216 | 1 | $report2configure->set_row_start('<tr>'); | |||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | 4 | $report2configure->set_row_end ("</tr>\n"); | |||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||
| 221 | 4 | $report2configure->set_header_row_start("<thead>\n<tr>"); | |||||||||||||||||||||||||||
| 222 | 4 | $report2configure->set_header_row_end ("</tr>\n</thead>\n"); | |||||||||||||||||||||||||||
| 223 | 4 | $report2configure->set_header_start("<th>"); | |||||||||||||||||||||||||||
| 224 | 4 | $report2configure->set_header_end ("</th>"); | |||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | 4 | ▶ | $report2configure->set_cell_start( sub { return "'<td '".$_[0].".'>'"; }); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 227 | 4 | $report2configure->set_cell_end ('</td>'); | |||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | 4 | $report2configure->set_horizontal_separation_start ("<hr>"); | |||||||||||||||||||||||||||
| 230 | 4 | $report2configure->set_horizontal_separation_end ("</hr>\n"); | |||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||
| 232 | 4 | my %AlignmentToHtml = ( | |||||||||||||||||||||||||||
| 233 | Left => 'left', | ||||||||||||||||||||||||||||
| 234 | Center => 'center', | ||||||||||||||||||||||||||||
| 235 | Right => 'right' | ||||||||||||||||||||||||||||
| 236 | ); | ||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||
| 238 | #=================================================================================== | ||||||||||||||||||||||||||||
| 239 | # | ||||||||||||||||||||||||||||
| 240 | # Configure Actions, no need to speed up | ||||||||||||||||||||||||||||
| 241 | # | ||||||||||||||||||||||||||||
| 242 | #=================================================================================== | ||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||
| 244 | # === Column store Action ============================================================ | ||||||||||||||||||||||||||||
| 245 | $report2configure->set_configure_column_action( | ||||||||||||||||||||||||||||
| 246 | 17 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=24 SCAR=38.8
| |||||||||||||||||||||||||||||
| 247 | 17 | my $report = shift; # instance_ref | |||||||||||||||||||||||||||
| 248 | 17 | my %options = @_; # options | |||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||
| 250 | 17 | ▶ | print_hash_ref(\%options) if verbose($report, 2); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||
| 252 | 17 | my $left = ""; # left from value | |||||||||||||||||||||||||||
| 253 | 17 | my $right = ""; # right from value | |||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||
| 255 | 17 | my $column_attributes = ""; # Attributes in td-Element | |||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||
| 257 | # --- default value --------------------------------------- | ||||||||||||||||||||||||||||
| 258 | 17 | my $default_value = get_option_value(\%options, qw (-default_value -def_val -dv)); | |||||||||||||||||||||||||||
| 259 | 17 | ▶ | $default_value = $report->get_default_cell_value() unless defined $default_value; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||
| 261 | # --- value --------------------------------------- | ||||||||||||||||||||||||||||
| 262 | 17 | my $value = interprete_value_options(\%options); | |||||||||||||||||||||||||||
| 263 | 17 | my $value_ref = ref($value); | |||||||||||||||||||||||||||
| 264 | 17 | my $value_action; | |||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||
| 266 | 17 | ▶ | die "value action not defined" unless defined $value; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||
| 268 | 17 | ▶ | if ( $value_ref) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 269 | 2 | ▶ | if ($value_ref =~ /^CODE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 270 | 2 | $value_action = $value; | |||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||
| 272 | else { | ||||||||||||||||||||||||||||
| 273 | # or what ?? | ||||||||||||||||||||||||||||
| 274 | 0 | die "# ref(value_ref) = $value_ref unknown"; | |||||||||||||||||||||||||||
| 275 | # $value_action = eval ("sub { return $$value; };"); | ||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||
| 277 | } | ||||||||||||||||||||||||||||
| 278 | else { | ||||||||||||||||||||||||||||
| 279 | 15 | $value = complete_value_code($value, $default_value); | |||||||||||||||||||||||||||
| 280 | 15 | $value_action = $report->create_action("$value;"); | |||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||
| 283 | # --- format value ---------------------------------------- | ||||||||||||||||||||||||||||
| 284 | 17 | my $format = get_option_value(\%options, qw (-format -f)); | |||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||
| 286 | 17 | ▶ | if ($format) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 287 | 0 | my $format_ref = ref($format); | |||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||
| 289 | 0 | ▶ | die "You used a '$format_ref' type to set the 'Format', " | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 290 | ."but currently only strings are supported!" | ||||||||||||||||||||||||||||
| 291 | if $format_ref; | ||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||
| 293 | 0 | ▶ | print "format $format\n" if verbose($report, 3); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||
| 295 | 0 | $left = "sprintf(\"$format\", ".$left; | |||||||||||||||||||||||||||
| 296 | 0 | $right .= ")"; | |||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||
| 299 | # --- escape special chars ---------------------------------------- | ||||||||||||||||||||||||||||
| 300 | 17 | my $escape_special_chars = get_option_value(\%options, qw (-escape_special_chars -esc_spec_chr -esc)); | |||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||
| 302 | 17 | my $do_escape_special_chars = 1; | |||||||||||||||||||||||||||
| 303 | 17 | ▶ | if (defined $escape_special_chars) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 304 | 0 | $do_escape_special_chars = $escape_special_chars; | |||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||
| 307 | 17 | my $esc_action = $self->get_escape_special_chars_action(); | |||||||||||||||||||||||||||
| 308 | 17 | ▶ | $do_escape_special_chars = 0 unless $esc_action; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||
| 310 | 17 | ▶ | if ($do_escape_special_chars) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 311 | 17 | $left = '$esc_action->('.$left; | |||||||||||||||||||||||||||
| 312 | 17 | $right .= ')'; | |||||||||||||||||||||||||||
| 313 | } | ||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||
| 315 | # --- coloring -------------------------------------------- | ||||||||||||||||||||||||||||
| 316 | 17 | my $color = get_option_value(\%options, qw (-color -c)); | |||||||||||||||||||||||||||
| 317 | 17 | my $color_action = undef; | |||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||
| 319 | 17 | ▶ | if ($color) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 320 | 0 | my $color_ref = ref($color); | |||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||
| 322 | 0 | ▶ | if ( $color_ref) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 323 | 0 | ▶ | if ($color_ref =~ /^CODE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 324 | 0 | $color_action = $color; | |||||||||||||||||||||||||||
| 325 | 0 | $column_attributes .= '. add_background_color_attribute($color_action->($_[0]))'; | |||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||
| 327 | else { | ||||||||||||||||||||||||||||
| 328 | # or what ?? | ||||||||||||||||||||||||||||
| 329 | 0 | die "# ref(color_ref) = $color_ref unknown"; | |||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||
| 332 | else { | ||||||||||||||||||||||||||||
| 333 | 0 | $column_attributes .= ".'" . add_background_color_attribute($color) ."'"; | |||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||
| 337 | # --- width is currently not supported --------------------- | ||||||||||||||||||||||||||||
| 338 | 17 | my $width = get_option_value(\%options, qw (-width -w)); | |||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||
| 340 | 17 | ▶ | print "width is currently not supported for html (width = $width)\n" if verbose($report, 3) && $width; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
verbose($report, 3) and $width
MC/DC0%0/2
verbose($report, 3) and $width
verbose($report, 3)
$width
Truth table33%1/3
A and B
A= verbose($report, 3)B= $width
| |||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||
| 342 | # --- align ----------------------------------------------- | ||||||||||||||||||||||||||||
| 343 | 17 | my $align = get_option_value(\%options, qw (-align -a)); | |||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||
| 345 | 17 | ▶ | if ($align) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 346 | 14 | my $align_ref = ref($align); | |||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||
| 348 | 14 | ▶ | die "You used a '$align_ref' type to set the 'Align', " | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 349 | ."but currently only strings are supported!" | ||||||||||||||||||||||||||||
| 350 | if $align_ref; | ||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||
| 352 | 14 | $align = interprete_alignment($align); | |||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||
| 354 | else { | ||||||||||||||||||||||||||||
| 355 | 3 | $align = $report->get_default_align(); | |||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||
| 358 | 17 | ▶ | print "align $align\n" if verbose($report, 3); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 359 | 17 | my $column_align = $AlignmentToHtml{$align}; | |||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||
| 361 | 17 | $column_attributes .= '.\' align="'.$column_align.'"\''; | |||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||
| 363 | # --- configure header ---------------------------- | ||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||
| 365 | 17 | my $header_text = get_option_value(\%options, qw (-header -h)); | |||||||||||||||||||||||||||
| 366 | 17 | ▶ | $header_text = '' unless defined $header_text; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 367 | 17 | push (@{$report->get_header_texts_ref()}, $header_text); | |||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||
| 369 | # --- --------------------------------------------- | ||||||||||||||||||||||||||||
| 370 | # --- --------------------------------------------- | ||||||||||||||||||||||||||||
| 371 | # --- --------------------------------------------- | ||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||
| 373 | # --- build cell content action --------------------------------------------- | ||||||||||||||||||||||||||||
| 374 | 17 | my $cell_action_str = $left.'$value_action->($_[0])'.$right; | |||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||
| 376 | 17 | my $cell_start = $report->get_cell_start()->($column_attributes); | |||||||||||||||||||||||||||
| 377 | 17 | my $cell_end = $report->get_cell_end(); | |||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||
| 379 | 17 | my $eval_str = 'sub { return '.$cell_start.".".$cell_action_str.'.$cell_end; }'; | |||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||
| 381 | 17 | ▶ | print "### eval_str = $eval_str\n" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 382 | if verbose($report, 3); | ||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||
| 384 | 17 | my $cell_action = eval ($eval_str); | |||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||
| 386 | 17 | ▶ | die $@ if $@; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||
| 388 | 17 | ▶ | print "### ref(cell_action) ".ref($cell_action) ."\n" if verbose($report, 3); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||
| 390 | 17 | $report->add_cell_output_action($cell_action); | |||||||||||||||||||||||||||
| 391 | 4 | }); | |||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||
| 393 | # === Configure Complete Action ==================================================== | ||||||||||||||||||||||||||||
| 394 | $report2configure->set_configure_complete_action( | ||||||||||||||||||||||||||||
| 395 | 4 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=18.3
| |||||||||||||||||||||||||||||
| 396 | 4 | my ($report, # instance_ref | |||||||||||||||||||||||||||
| 397 | ) = @_; | ||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||
| 399 | 4 | my $row_start = $report->get_row_start(); | |||||||||||||||||||||||||||
| 400 | 4 | my $row_start_ref = ref($row_start); | |||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||
| 402 | 4 | ▶ | if ( $row_start_ref) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 403 | 3 | ▶ | if ($row_start_ref =~ /^CODE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 404 | 3 | $row_start = $row_start->(); # replace sub by content of call | |||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||
| 406 | else { | ||||||||||||||||||||||||||||
| 407 | # or what ?? | ||||||||||||||||||||||||||||
| 408 | 0 | die "# ref(row_start_ref) = $row_start_ref unknown"; | |||||||||||||||||||||||||||
| 409 | # $value_action = eval ("sub { return $$value; };"); | ||||||||||||||||||||||||||||
| 410 | } | ||||||||||||||||||||||||||||
| 411 | } | ||||||||||||||||||||||||||||
| 412 | |||||||||||||||||||||||||||||
| 413 | 4 | my $cell_start = $report->get_cell_start(); | |||||||||||||||||||||||||||
| 414 | 4 | my $cell_start_ref = ref($cell_start); | |||||||||||||||||||||||||||
| 415 | |||||||||||||||||||||||||||||
| 416 | 4 | ▶ | if ( $cell_start_ref) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 417 | 4 | ▶ | if ($cell_start_ref =~ /^CODE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 418 | 4 | $cell_start = eval ($cell_start->('')); # replace sub by content of call | |||||||||||||||||||||||||||
| 419 | } | ||||||||||||||||||||||||||||
| 420 | else { | ||||||||||||||||||||||||||||
| 421 | # or what ?? | ||||||||||||||||||||||||||||
| 422 | 0 | die "# ref(cell_start_ref) = $cell_start_ref unknown"; | |||||||||||||||||||||||||||
| 423 | # $value_action = eval ("sub { return $$value; };"); | ||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||
| 425 | } | ||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||
| 427 | 4 | my $sep = $row_start; | |||||||||||||||||||||||||||
| 428 | |||||||||||||||||||||||||||||
| 429 | 4 | foreach my $idx (1..scalar(@{$report->get_cell_output_actions()})) { | |||||||||||||||||||||||||||
| 430 | 17 | $sep .= $cell_start."<hr/>".$report->get_cell_end(); | |||||||||||||||||||||||||||
| 431 | } | ||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||
| 433 | 4 | $sep .= $report->get_row_end(); | |||||||||||||||||||||||||||
| 434 | |||||||||||||||||||||||||||||
| 435 | 4 | $report->set_header_line ($sep); | |||||||||||||||||||||||||||
| 436 | 4 | $report->set_separator_line ($sep); | |||||||||||||||||||||||||||
| 437 | 4 | }); | |||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||
| 439 | #=================================================================================== | ||||||||||||||||||||||||||||
| 440 | # | ||||||||||||||||||||||||||||
| 441 | # Runtime Actions, no need to speed up | ||||||||||||||||||||||||||||
| 442 | # | ||||||||||||||||||||||||||||
| 443 | #=================================================================================== | ||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||
| 445 | # === Header Output Action ============================================================ | ||||||||||||||||||||||||||||
| 446 | $report2configure->set_header_output_action( | ||||||||||||||||||||||||||||
| 447 | 1 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 448 | 1 | my ($report, # instance_ref | |||||||||||||||||||||||||||
| 449 | $data_ref # data to output | ||||||||||||||||||||||||||||
| 450 | ) = @_; | ||||||||||||||||||||||||||||
| 451 | |||||||||||||||||||||||||||||
| 452 | 1 | my $header_string = $report->get_header_row_start(); | |||||||||||||||||||||||||||
| 453 | 1 | foreach my $header_text (@{$data_ref}) { | |||||||||||||||||||||||||||
| 454 | 4 | $header_string .= $report->get_header_start() | |||||||||||||||||||||||||||
| 455 | .$header_text | ||||||||||||||||||||||||||||
| 456 | .$report->get_header_end(); | ||||||||||||||||||||||||||||
| 457 | } | ||||||||||||||||||||||||||||
| 458 | |||||||||||||||||||||||||||||
| 459 | 1 | $header_string .= $report->get_header_row_end(); | |||||||||||||||||||||||||||
| 460 | |||||||||||||||||||||||||||||
| 461 | 1 | ▶ | print "### Header String:$header_string" if verbose($report, 2); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||
| 463 | 1 | return $header_string; | |||||||||||||||||||||||||||
| 464 | 4 | }); | |||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||
| 466 | # === Start Table Output Action ============================================================ | ||||||||||||||||||||||||||||
| 467 | $report2configure->set_start_table_output_action( | ||||||||||||||||||||||||||||
| 468 | 1 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 469 | 1 | my ($report, # instance_ref | |||||||||||||||||||||||||||
| 470 | $data_ref # data to output | ||||||||||||||||||||||||||||
| 471 | ) = @_; | ||||||||||||||||||||||||||||
| 472 | |||||||||||||||||||||||||||||
| 473 | 1 | return $report->get_file_start() | |||||||||||||||||||||||||||
| 474 | .$report->get_table_start() | ||||||||||||||||||||||||||||
| 475 | .$report->get_header_output(); | ||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||
| 477 | 4 | }); | |||||||||||||||||||||||||||
| 478 | |||||||||||||||||||||||||||||
| 479 | # === End Table Output Action ============================================================ | ||||||||||||||||||||||||||||
| 480 | $report2configure->set_end_table_output_action( | ||||||||||||||||||||||||||||
| 481 | 1 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 482 | 1 | my ($report, # instance_ref | |||||||||||||||||||||||||||
| 483 | $data_ref # data to output | ||||||||||||||||||||||||||||
| 484 | ) = @_; | ||||||||||||||||||||||||||||
| 485 | |||||||||||||||||||||||||||||
| 486 | 1 | return $report->get_table_end() | |||||||||||||||||||||||||||
| 487 | .$report->get_file_end(); | ||||||||||||||||||||||||||||
| 488 | 4 | }); | |||||||||||||||||||||||||||
| 489 | |||||||||||||||||||||||||||||
| 490 | #=================================================================================== | ||||||||||||||||||||||||||||
| 491 | # | ||||||||||||||||||||||||||||
| 492 | # Runtime Mass Data Actions, be careful, don't slow it down !! | ||||||||||||||||||||||||||||
| 493 | # | ||||||||||||||||||||||||||||
| 494 | #=================================================================================== | ||||||||||||||||||||||||||||
| 495 | |||||||||||||||||||||||||||||
| 496 | 4 | my $previous_data_ref = ''; | |||||||||||||||||||||||||||
| 497 | |||||||||||||||||||||||||||||
| 498 | # === Row Output Action ============================================================ | ||||||||||||||||||||||||||||
| 499 | $report2configure->set_row_output_action( | ||||||||||||||||||||||||||||
| 500 | 5 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=7 SCAR=19.8
| |||||||||||||||||||||||||||||
| 501 | 5 | my ($report, # instance_ref | |||||||||||||||||||||||||||
| 502 | $data_ref # data to output | ||||||||||||||||||||||||||||
| 503 | ) = @_; | ||||||||||||||||||||||||||||
| 504 | |||||||||||||||||||||||||||||
| 505 | 5 | my $row_start = $report->get_row_start(); | |||||||||||||||||||||||||||
| 506 | 5 | my $row_start_ref = ref($row_start); | |||||||||||||||||||||||||||
| 507 | |||||||||||||||||||||||||||||
| 508 | 5 | ▶ | if ( $row_start_ref) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 509 | 4 | ▶ | if ($row_start_ref =~ /^CODE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 510 | 4 | $row_start = $row_start->(); # replace sub by content of call | |||||||||||||||||||||||||||
| 511 | } | ||||||||||||||||||||||||||||
| 512 | else { | ||||||||||||||||||||||||||||
| 513 | # or what ?? | ||||||||||||||||||||||||||||
| 514 | 0 | die "# ref(row_start_ref) = $row_start_ref unknown"; | |||||||||||||||||||||||||||
| 515 | # $value_action = eval ("sub { return $$value; };"); | ||||||||||||||||||||||||||||
| 516 | } | ||||||||||||||||||||||||||||
| 517 | } | ||||||||||||||||||||||||||||
| 518 | |||||||||||||||||||||||||||||
| 519 | 5 | my $row_string = ''; | |||||||||||||||||||||||||||
| 520 | |||||||||||||||||||||||||||||
| 521 | # --- Add something when group changes ---- | ||||||||||||||||||||||||||||
| 522 | 5 | my $row_group_changes_action = $report->get_row_group_changes_action(); | |||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||
| 524 | 5 | ▶ | $row_string .= $row_group_changes_action->($previous_data_ref, $data_ref) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 525 | if $row_group_changes_action; | ||||||||||||||||||||||||||||
| 526 | |||||||||||||||||||||||||||||
| 527 | 5 | $previous_data_ref = $data_ref; | |||||||||||||||||||||||||||
| 528 | |||||||||||||||||||||||||||||
| 529 | # --- start new row ----------------------- | ||||||||||||||||||||||||||||
| 530 | 5 | $row_string .= $row_start; | |||||||||||||||||||||||||||
| 531 | |||||||||||||||||||||||||||||
| 532 | 5 | my $cell_output_actions_ref = $report->get_cell_output_actions(); | |||||||||||||||||||||||||||
| 533 | |||||||||||||||||||||||||||||
| 534 | 5 | foreach my $action (@$cell_output_actions_ref) { | |||||||||||||||||||||||||||
| 535 | 21 | ▶ | print "### action $action\n" if verbose($report, 4); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 536 | 21 | $row_string .= $action->($data_ref); | |||||||||||||||||||||||||||
| 537 | } | ||||||||||||||||||||||||||||
| 538 | |||||||||||||||||||||||||||||
| 539 | 5 | $row_string .= $report->get_row_end(); | |||||||||||||||||||||||||||
| 540 | |||||||||||||||||||||||||||||
| 541 | 5 | ▶ | print "### Row String:$row_string" if verbose($report, 2); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 542 | |||||||||||||||||||||||||||||
| 543 | 5 | return $row_string; | |||||||||||||||||||||||||||
| 544 | 4 | }); | |||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||
| 546 | 4 | return $report2configure; | |||||||||||||||||||||||||||
| 547 | } | ||||||||||||||||||||||||||||
| 548 | |||||||||||||||||||||||||||||
| 549 | 1 | 1; | |||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||
| 551 | =head1 NAME | ||||||||||||||||||||||||||||
| 552 | |||||||||||||||||||||||||||||
| 553 | C<Report::Porf::Table::Simple::HtmlReportConfigurator> | ||||||||||||||||||||||||||||
| 554 | |||||||||||||||||||||||||||||
| 555 | Configures a Report::Porf::Table::Simple to write out HTML tables. | ||||||||||||||||||||||||||||
| 556 | |||||||||||||||||||||||||||||
| 557 | Part of Perl Open Report Framework (Porf). | ||||||||||||||||||||||||||||
| 558 | |||||||||||||||||||||||||||||
| 559 | =head1 Documentation | ||||||||||||||||||||||||||||
| 560 | |||||||||||||||||||||||||||||
| 561 | See Report::Porf::Framework.pm for documentation of features and usage. | ||||||||||||||||||||||||||||
| 562 | |||||||||||||||||||||||||||||
| 563 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||||||||||
| 564 | |||||||||||||||||||||||||||||
| 565 | Copyright (c) 2013 by Ralf Peine, Germany. All rights reserved. | ||||||||||||||||||||||||||||
| 566 | |||||||||||||||||||||||||||||
| 567 | This library is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 568 | it under the same terms as Perl itself, either Perl version 5.6.0 or, | ||||||||||||||||||||||||||||
| 569 | at your option, any later version of Perl 5 you may have available. | ||||||||||||||||||||||||||||
| 570 | |||||||||||||||||||||||||||||
| 571 | =head1 DISCLAIMER OF WARRANTY | ||||||||||||||||||||||||||||
| 572 | |||||||||||||||||||||||||||||
| 573 | This library is distributed in the hope that it will be useful, | ||||||||||||||||||||||||||||
| 574 | but without any warranty; without even the implied warranty of | ||||||||||||||||||||||||||||
| 575 | merchantability or fitness for a particular purpose. | ||||||||||||||||||||||||||||
| 576 | |||||||||||||||||||||||||||||
| 577 | =cut | ||||||||||||||||||||||||||||