Subreport(3pm)
π Lire::Subreport β the interface to a Lire subreport, bestie π
okay so this is Subreport(3pm), a page from LogReport's Lire Documentation, and it's literally your gateway to the subreports living inside the sections of a Lire report. yes queen, we're going in. π¦
β¨ SYNOPSIS β¨
use Lire::ReportParser::ReportBuilder;
my $parser = new Lire::ReportParser::ReportBuilder;
my $report = $parser->parse( "report.xml" );
foreach my $s ( $report->sections() ) {
print "Section: '", $s->title(), "\n\n";
foreach my $r ( $s->subreports() ) {
print "Subreport ", $r->title(), " has ", scalar $r->entries(),
" entries\n";
}
}
like, that's the whole vibe right there: parse a report, walk the sections, walk the subreports, print their titles and entry counts. slay. π
πΈ DESCRIPTION πΈ
This module hands you an API to the subreports that are chillin' inside the sections of a Lire report. π
Here's the tea: this object has all the methods that the Lire::Report::Group(3pm) object offers. So if you wanna know how to actually access the data inside a subreport, go read that man page β it's got the lore. πβ¨
π CONSTRUCTORS π
new( $superservice, $type)
Creates a shiny new Lire::Report::Subreport object. β¨ The $superservice parameter and the $type parameter together define the report specification that was used to generate this subreport's data.
new_missing( $superservice, $type, [$reason])
Creates a new Lire::Report::Subreport object, but marks it as missing π. Again, $superservice and $type define the report specification that generated this subreport's data. The optional $reason parameter sets the reason why this subreport is missing β so everyone knows what went down.
π OBJECT METHODS π
id( [ $new_id ] )
Returns the id of this subreport (and optionally changes it if you pass $new_id). The subreport's ID uniquely identifies it within its Report. and heads up π β subreports with the same ID will be merged together.
is_missing()
Returns true if this subreport was marked as missing in the XML file. A missing subreport is one that was present in the report configure file but got marked as missing in the XML report. When does that happen, you ask? when the report specification requires fields that weren't available in the DLF files that got generated. It can also happen when an error occurs in the report generation process. π
missing_reason()
Spills why the subreport is missing. This will be undef when the subreport is not missing β i.e. no drama to report. π
superservice()
Returns the superservice of this subreport. This is the superservice that defined the report specification from which the subreport was generated. it's giving origin story. π
type()
Returns the type of this subreport. This is the ID of the report specification that was used to generate this subreport.
schemas( [ $schema, ... ] )
Returns the schemas used by this Subreport. π
field_schema( $field )
Returns the schema which contains field $field. Returns undef if this name isn't defined in any schema. no schema, no entry, bestie. π«Ά
chart_configs()
Returns an array reference containing Lire::Report::ChartConfig objects specifying the charts that should be generated from this Subreport. πβ¨
add_chart_config( $chart_config )
Adds a Lire::Report::ChartConfig object specifying a chart that should be generated from this Subreport's data. more charts = more main character energy. π₯
title( [$title] )
Returns the subreport's title.
If the $title parameter is set, the subreport's title will be set to this new value.
description( [$new_desc] )
Returns this subreport's description. The description is encoded in DocBook XML. π
If the $description parameter is set, this method will set this subreport's description to this new value. If the $description parameter is undef, that description will be removed. gone. deleted. periodt. π
table_info( [$table_info] )
Returns the top-level Lire::Report::TableInfo object describing this table layout. If the $table_info parameter is set, the subreport table info will be set to this object.
nrows()
Returns the number of rows in the table. π’
last_row_idx()
Returns the index of the last row of data.
getrow_by_idx( $index )
Returns an array reference containing row 'idx' of the subreport data. A row will contain all the values (categorical and numerical) that would appear on the same row. When an entry is made of categorical variables plus nested groups, the group's summary values will appear on the same row as the categorical variable. π§
Each value is the hash reference that is returned by Entry::data_by_name() for that column, and it sits in the row at the column's index.
getrows()
Returns all rows contained in the subreport. This method is useful for rendering the subreport table. π
finalize()
This method should be called after all entries were added. It assigns row-idx and computes column width and statistics. so like, the final glow-up pass. β¨π
π¦ SEE ALSO π¦
Lire::ReportParser::ReportBuilder(3pm)Lire::Report::Section(3pm)Lire::Report::Report(3pm)Lire::Report::Entry(3pm)Lire::Report::Group(3pm)Lire::Report::ChartConfig(3pm)
β VERSION β
$Id: Subreport.pm,v 1.46 2006/07/23 13:16:31 vanbaal Exp $
πΈ COPYRIGHT πΈ
Copyright (C) 2002, 2004 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
fr fr, read the license, it's not just decoration ππ
π AUTHOR π
Francis J. Lacoste <flacoste@logreport.org>
and that's the whole page, bestie! π it's Lire 2.1.1, dated 2025-09-28, and yeah β this very page is literally called Subreport(3pm). mwah π go parse some reports, you got this π«Άβ¨
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms