Spreadsheet::Compare::Reporter - Abstract Base Class for Reporters
This module defines the methods and attributes that are provided for or need to be overrridden by a Spreadsheet::Compare::Reporter subclass.
When subclassing consider using Spreadsheet::Compare::Common for convenience.
All read write attributes can be set as options from the config file passed to Spreadsheet::Compare or spreadcomp.
The defaults for the fmt_* attributes are specific to the Reporter subclass and are documented there.
fmt_*
The format for the header line.
The format for marking headers of columns that contain differences.
The default format for a single cell.
The default format for a cell on the left side of the comparison with an odd line index.
The default format for a cell on the right side of the comparison with an odd line index.
The default format for a cell of the differences line with an odd line index. (only with "report_diff_row")
The default format for a cell on the left side of the comparison with an even line index.
The default format for a cell on the right side of the comparison with an even line index.
The default format for a cell of the differences line with an even line index. (only with "report_diff_row")
Format set on the left side when a difference was detected and at least one limit was exceeded.
Format set on the right side when a difference was detected and at least one limit was exceeded.
Format set in the differences line when a difference was detected and at least one limit was exceeded. (only with "report_diff_row")
Format set on the left side when a difference was detected and all deviations are below their limits.
Format set on the right side when a difference was detected and all deviations are below their limits.
Format sset in the differences line when a difference was detected and all deviations are below their limits. (only with "report_diff_row")
possible values: 0|1 default: 0
Add a row with the absolute (or relative if "diff_relative" in <Spreadsheet::Compare::Single> is used ) differences after each pair of data lines in the diff output.
possible values: <string> default: undef
The output filename for the generated report. This will be prepended with the directory set with the "rootdir" in Spreadsheet::Compare option unless it is an absolute filename.
Per default ignored columns will not be written to reports. Setting this option will include them. They will be marked as 'IGNORED' when "report_diff_row" is set.
Add a column named '__SLN__' to the report output containing the record's line number in the source file should the Reader module provide it.
Add a column named __SRC__ specifying the source name in the diff output. The names set by the options "left" and "right" will be used. For diff lines it will be 'diff'.
possible values: 0|1 default: 1
Add the columns ABS_FIELD, ABS_VALUE, REL_FIELD and REL_VALUE to the diff output. They indicate the field names and maximal differences for absolute and relative deviations for a line comparison.
Set by Spreadsheet::Compare during reporter initialisation. Same as "rootdir" in Spreadsheet::Compare.
readonly) A reference to an array with the column headers for statistics information
readonly) A copy of "title" in Spreadsheet::Compare::Single
The methods marked as event handler have to implemented by subclasses to handle events emitted by Spreadsheet::Compare::Single (see "EVENTS" in Spreadsheet::Compare::Single for descriptions of the event parameters).
(event handler)
Return a reference to an array with all valid output values for a record according to the current reporting attributes (e.g. "report_ignored_colums", "report_max_columns", ...)
Return the full report filename by combining "rootdir" and $fn (defaults to "report_filename"). Will just return the filename if it is absolute.
Will be called by Spreadsheet::Compare after a comparison has finished and the report_finished event was emitted. The Reporter can safely close the report.
Will be called by Spreadsheet::Compare before starting a comparison. Does not need to be implemented by subclasses.
Remove ignored columns from the referenced array. The array has to be the same length as a source record.
Will be called by Spreadsheet::Compare after completion of all comparisons when "summary" in Spreadsheet::Compare is set.
To install Spreadsheet::Compare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Spreadsheet::Compare
CPAN shell
perl -MCPAN -e shell install Spreadsheet::Compare
For more information on module installation, please visit the detailed CPAN module installation guide.