NAME

oEdtk::libXls - build paginated Excel workbooks from tabular data

SYNOPSIS

use oEdtk::libXls;

prod_Xls_Init('', 'Title', '');
prod_Xls_Col_Init('AL20', 'AC10');
prod_Xls_Insert_Val(@row);
prod_Xls_Edit_Ligne();
prod_Xls_Close();

DESCRIPTION

Builds Excel workbooks from tabular data with Spreadsheet::WriteExcel: it opens numbered output files, applies the named cell formats of %XLS_FORMAT, writes rows and pages, and prints the list of the files produced. The module is loaded in UTF-8.

FUNCTIONS

prod_Xls_Init

my $workbook = prod_Xls_Init($left, $center, $right);

Open a new workbook and its first worksheet, set the page header from the three texts, and register the file name in the produced-files list. Returns a reference to the workbook.

prod_Xls_New

prod_Xls_New($option);

Start a new workbook. When $option is HEAD, the table head is repeated first.

prod_Xls_Insert_Val

prod_Xls_Insert_Val(@values);

Append one or more values to the pending row buffer.

prod_Xls_Col_Init

prod_Xls_Col_Init(@columns);

Initialise the style and width of the columns from STYLEwidth pairs, for example AL20.

prod_Xls_Edit_Ligne

prod_Xls_Edit_Ligne($format, $head);

Flush the pending values as one row, with an optional per-row format and an optional HEAD column-head flag.

prod_Xls_Row_Height

prod_Xls_Row_Height($height);

Set the height of the next row, in points.

prod_Xls_Add_Sheet

my $sheet = prod_Xls_Add_Sheet($name);

Add a worksheet to the open workbook, print the head if one was defined, and return the worksheet.

prod_Xls_Close

prod_Xls_Close();

Flush the last row, print the list of the files produced, and close the workbook. It is also called automatically at the end of the program through an END block.

prod_Xls_Liste_Output

my @files = prod_Xls_Liste_Output();

Return the list of the Excel files produced so far.

%XLS_FORMAT

$worksheet->write($row, $col, $value, $XLS_FORMAT{'AC'});

The table of the named cell formats (alignment, font, borders) referenced by the column initialisation and the row editor.

The following subs are internal helpers and are not part of the public API: prod_Xls_Set_Sheet, prod_Xls_Head and prod_Xls_Set_Format.

AUTHOR

The oEdtk team.