NAME

Spreadsheet::Compare::Reporter - Abstract Base Class for Reporters

DESCRIPTION

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.

ATTRIBUTES

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_head

The format for the header line.

fmt_headerr

The format for marking headers of columns that contain differences.

fmt_default

The default format for a single cell.

fmt_left_odd

The default format for a cell on the left side of the comparison with an odd line index.

fmt_right_odd

The default format for a cell on the right side of the comparison with an odd line index.

fmt_diff_odd

The default format for a cell of the differences line with an odd line index. (only with "report_diff_row")

fmt_left_even

The default format for a cell on the left side of the comparison with an even line index.

fmt_right_even

The default format for a cell on the right side of the comparison with an even line index.

fmt_diff_even

The default format for a cell of the differences line with an even line index. (only with "report_diff_row")

fmt_left_high

Format set on the left side when a difference was detected and at least one limit was exceeded.

fmt_right_high

Format set on the right side when a difference was detected and at least one limit was exceeded.

fmt_diff_high

Format set in the differences line when a difference was detected and at least one limit was exceeded. (only with "report_diff_row")

fmt_left_low

Format set on the left side when a difference was detected and all deviations are below their limits.

fmt_right_low

Format set on the right side when a difference was detected and all deviations are below their limits.

fmt_diff_low

Format sset in the differences line when a difference was detected and all deviations are below their limits. (only with "report_diff_row")

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.

report_filename

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.

report_ignored_columns

possible values: 0|1
default: 0

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.

report_line_numbers

possible values: 0|1
default: 0

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.

report_line_source

possible values: 0|1
default: 0

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'.

report_max_columns

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.

rootdir

Set by Spreadsheet::Compare during reporter initialisation. Same as "rootdir" in Spreadsheet::Compare.

stat_head

readonly) A reference to an array with the column headers for statistics information

METHODS

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).

add_stream($name)

(event handler)

mark_header($stream, $mask)

(event handler)

output_record ($record_obj)

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", ...)

report_fullname([$fn])

Return the full report filename by combining "rootdir" and $fn (defaults to "report_filename"). Will just return the filename if it is absolute.

save_and_close()

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.

setup

Will be called by Spreadsheet::Compare before starting a comparison. Does not need to be implemented by subclasses.

strip_ignore ($record_aref)

Remove ignored columns from the referenced array. The array has to be the same length as a source record.

write_header($stream)

(event handler)

write_row($stream, $record_obj)

(event handler)

write_fmt_row($stream, $record_obj)

(event handler)

write_summary($stats, $filename)

Will be called by Spreadsheet::Compare after completion of all comparisons when "summary" in Spreadsheet::Compare is set.