Nicolas Steenlant
and 3 contributors

NAME

Catmandu::Exporter::XLSX - a XLSX exporter

VERSION

Version 0.01

SYNOPSIS

    use Catmandu::Exporter::XLSX;

    my $exporter = Catmandu::Exporter::XLSX->new(
                                file => 'output.xlsx',
                                fix => 'myfix.txt'
                                header => 1);

    $exporter->fields("f1,f2,f3");

    # add custom header labels
    $exporter->header({f2 => 'field two'});

    $exporter->add_many($arrayref);
    $exporter->add_many($iterator);
    $exporter->add_many(sub { });

    $exporter->add($hashref);

    $exporter->commit;

    printf "exported %d objects\n" , $exporter->count;

METHODS

new(header => 0|1|HASH, fields => ARRAY|HASH|STRING)

Creates a new Catmandu::Exporter::XLSX. A header line with field names will be included if header is set. Field names can be read from the first item exported or set by the fields argument (see: fields).

fields($arrayref)

Set the field names by an ARRAY reference.

fields($hashref)

Set the field names by the keys of a HASH reference.

fields($string)

Set the fields by a comma delimited string.

header(1)

Include a header line with the field names

header($hashref)

Include a header line with custom field names

commit

Commit the changes and close the XLSX.

SEE ALSO

Catmandu::Exporter::XLS, Catmandu::Importer::XLS, <Catmandu::Importer::XLSX>.