1 package SL::Controller::Helper::ReportGenerator::ControlRow::SimpleData;
5 use parent qw(SL::Controller::Helper::ReportGenerator::ControlRow::Base);
12 push @errors, 'type "simple_data" needs a parameter "data" as hash ref' if !$self->params->{data} || ('HASH' ne ref $self->params->{data});
18 my ($self, $report) = @_;
22 $tmp->{data} = $self->params->{data}->{$_};
24 } keys %{ $self->params->{data} };
26 $report->add_data(\%data);
39 SL::Controller::Helper::ReportGenerator::ControlRow::SimpleData - an
40 implementaion of a control row class to display simple data
44 This class implements a control row for the report generator helper to display
45 simple data. C<Simple> because you only have to provide the column and your data
50 use SL::Controller::Helper::ReportGenerator;
51 use SL::Controller::Helper::ReportGenerator::ControlRow qw(make_control_row);
56 # Set up the report generator instance. In this example this is
57 # hidden in "prepare_report".
58 my $report = $self->prepare_report;
60 # Get objects from database.
61 my $objects = SL::DB::Manager::TimeRecording->get_all(...);
64 push @$objects, make_control_row(
66 data => { duration => 'Total sum of duration is not implemeted yet' }
69 # Let report generator create the output.
70 $self->report_generator_list_objects(
78 This control row gets the paramter C<data>, which must a hash ref.
79 The keys are the column names for the fields you want to show your
80 data. The values are the data.
84 Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>