NAME

Spreadsheet::Reader::ExcelXML::XMLReader::FileWorksheet - Zip file worksheet interpreter

SYNOPSIS

See t\Spreadsheet\Reader\ExcelXML\XMLReader\05-file_worksheet.t

DESCRIPTION

This documentation is written to explain ways to use this module when writing your own excel parser. To use the general package for excel parsing out of the box please review the documentation for Workbooks, Worksheets, and Cells

This module incrementally adds functionality to the base class Spreadsheet::Reader::ExcelXML::XMLReader. The goal is to parse individual worksheet files (not chartsheets) from the zip file format (.xlsx) into perl objects The primary purpose of this role is to normalize functions used by Spreadsheet::Reader::ExcelXML::WorksheetToRow where other roles could be used to normalize other formats. It does not provide a way to read chartsheets.

All positions (row and column places and integers) at this level are stored and returned in count from one mode!

To replace this part in the package look in the raw code of Spreadsheet::Reader::ExcelXML::Workbook and adjust the 'worksheet_interface' key of the $parser_modules variable.

requires

This module is a role and as such only adds incremental methods and attributes to some base class. In order to use this role some base object methods are required. The requirments are listed below with links to the default provider.

"current_named_node" in Spreadsheet::Reader::ExcelXML::XMLReader

"current_node_parsed" in Spreadsheet::Reader::ExcelXML::XMLReader

"advance_element_position" in Spreadsheet::Reader::ExcelXML::XMLReader

"good_load" in Spreadsheet::Reader::ExcelXML::XMLReader

"start_the_file_over" in Spreadsheet::Reader::ExcelXML::XMLReader

"squash_node" in Spreadsheet::Reader::ExcelXML::XMLReader

"parse_element" in Spreadsheet::Reader::ExcelXML::XMLReader

"_parse_column_row" in Spreadsheet::Reader::ExcelXML::CellToColumnRow

"spreading_merged_values" in Spreadsheet::Reader::ExcelXML

"should_skip_hidden" in Spreadsheet::Reader::ExcelXML

"has_shared_strings_interface" in Spreadsheet::Reader::ExcelXML

"are_spaces_empty" in Spreadsheet::Reader::ExcelXML

"get_empty_return_type" in Spreadsheet::Reader::ExcelXML

"get_values_only" in Spreadsheet::Reader::ExcelXML

"starts_at_the_edge" in Spreadsheet::Reader::ExcelXML

"collecting_merge_data" in Spreadsheet::Reader::ExcelXML

"collecting_column_formats" in Spreadsheet::Reader::ExcelXML

"get_shared_string( $positive_int/$name )" in Spreadsheet::Reader::ExcelXML::SharedStrings

Attributes

Data passed to new when creating an instance. This list only contains public attributes incrementally provided by this role. For access to the values in these attributes see the listed 'attribute methods'. For general information on attributes see Moose::Manual::Attributes. For ways to manage the instance when opened see the Methods.

is_hidden

Definition: This data is collected at the workbook level for this file type. It indicates if the sheet is human visible.

Range: (1|0)

attribute methods Methods provided to adjust this attribute

is_sheet_hidden

Definition: return the attribute value

_sheet_min_col

Definition: This is the minimum column in the sheet with data or formatting. For this module it is pulled from the xml file at worksheet/dimension:ref = "upperleft:lowerright"

Range: an integer

attribute methods Methods provided to adjust this attribute

_min_col

Definition: returns the attribute value

has_min_col

Definition: attribute predicate

_sheet_min_row

Definition: This is the minimum row in the sheet with data or formatting. For this module it is pulled from the xml file at worksheet/dimension:ref = "upperleft:lowerright"

Range: an integer

attribute methods Methods provided to adjust this attribute

_set_min_row

Definition: sets the attribute value

_min_row

Definition: returns the attribute value

has_min_row

Definition: attribute predicate

_sheet_max_col

Definition: This is the maximum column in the sheet with data or formatting. For this module it is pulled from the xml file at worksheet/dimension/ref = "upperleft:lowerright"

Range: an integer

attribute methods Methods provided to adjust this attribute

_set_max_col

Definition: sets the attribute value

_max_col

Definition: returns the attribute value

has_max_col

Definition: attribute predicate

_sheet_max_row

Definition: This is the maximum row in the sheet with data or formatting. For this module it is pulled from the xml file at worksheet/dimension:ref = "upperleft:lowerright"

Range: an integer

attribute methods Methods provided to adjust this attribute

_set_max_row

Definition: sets the attribute value

_max_row

Definition: returns the attribute value

has_max_row

Definition: attribute predicate

Methods

These are the methods provided by this class for use within the package but are not intended to be used by the end user. Other private methods not listed here are used in the module but not used by the package. If a method is listed here then replacement of this module either requires replacing the method or rewriting all the associated connecting roles and classes.

load_unique_bits

Definition: This is called by Spreadsheet::Reader::ExcelXML::XMLReader when the file is loaded for the first time so that file specific metadata can be collected.

Accepts: nothing

Returns: nothing

advance_row_position( $increment )

Definition: As an XML data structure each worksheet has three levels of information. The column data is stored separately in the file and just referenced. The row data encases all the cell data for that row. Each cell contains modifiers to row and column settings. The column data is read during the 'load_unique_bits' method. The cell specific data is not completed here. This method will advance to the next recorded row position in the XML file. Not to be confused with the next row number. If you want to advance to the 'next' position more than one time then you can provide a value for $increment.

Accepts: a positive integer $increment (defaults to 1 if no value passed)

Returns: The attribute ref of the top row node

build_row_data

Definition: Collects all the sub-information (XML node) for the row in order to build the argument for populating a Spreadsheet::Reader::ExcelXML::Row instance.

Accepts: nothing

Returns: a hash ref of inputs for Spreadsheet::Reader::ExcelXML::Row

get_custom_column_data( $column )

Definition: Returns any collected custom column information for the indicated $column.

Accepts: a positive integer $column in count from 1 context

Returns: a hash ref of custom column settings

get_custom_row_data( $row )

Definition: Returns any collected custom row information for the indicated $row.

Accepts: a positive integer $row in count from 1 context

Returns: a hash ref of custom row settings

get_merge_map

Definition: This returns the full merge map with merge ranges stored in each position for the range of known rows and columns.

Accepts: nothing

Returns: an array ref of array refs where the top level array represents rows stored in count from 1 context and the second level array ref are the columns stored in count from 1 context. (The first position for each will therefor be dead space)

SUPPORT

github Spreadsheet::Reader::ExcelXML/issues

TODO

1. If a the primary cell of a merge range is hidden show that value in the top left unhidden cell even when the attribute "spread_merged_values" in Spreadsheet::Reader::ExcelXML::Workbook is not set. (This is the way excel does it(ish))

AUTHOR

Jed Lund
jandrew@cpan.org

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

This software is copyrighted (c) 2016 by Jed Lund

DEPENDENCIES

Spreadsheet::Reader::ExcelXML - the package

SEE ALSO

Spreadsheet::Read - generic Spreadsheet reader

Spreadsheet::ParseExcel - Excel binary version 2003 and earlier (.xls files)

Spreadsheet::XLSX - Excel version 2007 and later

Spreadsheet::ParseXLSX - Excel version 2007 and later

Log::Shiras

All lines in this package that use Log::Shiras are commented out