NAME
Net::Google::Spreadsheets::Worksheet - Representation of worksheet.
SYNOPSIS
my $service = Net::Google::Spreadsheets->new(
username => 'mygoogleaccount@example.com',
password => 'mypassword',
);
my $ss = $service->spreadsheet(
{
key => 'key_of_a_spreasheet'
}
);
my $worksheet = $ss->worksheet({title => 'Sheet1'});
# update cell by batch request
$worksheet->batchupdate_cell(
{col => 1, row => 1, input_value => 'name'},
{col => 2, row => 1, input_value => 'nick'},
{col => 3, row => 1, input_value => 'mail'},
{col => 4, row => 1, input_value => 'age'},
);
# get a cell object
my $cell = $worksheet->cell({col => 1, row => 1});
# add a row
my $new_row = $worksheet->add_row(
{
name => 'Nobuo Danjou',
nick => 'lopnor',
mail => 'nobuo.danjou@gmail.com',
age => '33',
}
);
# get rows
my @rows = $worksheet->rows;
# search rows
@rows = $worksheet->rows({sq => 'age > 20'});
# search a row
my $row = $worksheet->row({sq => 'name = "Nobuo Danjou"'});
METHODS
rows(\%condition)
Returns a list of Net::Google::Spreadsheets::Row objects. Acceptable arguments are:
- sq
-
Structured query on the full text in the worksheet. see the URL below for detail.
- orderby
-
Set column name to use for ordering.
- reverse
-
Set 'true' or 'false'. The default is 'false'.
See http://code.google.com/intl/en/apis/spreadsheets/docs/2.0/reference.html#ListParameters for details.
row(\%condition)
Returns first item of spreadsheets(\%condition) if available.
cells(\%args)
Returns a list of Net::Google::Spreadsheets::Cell objects. Acceptable arguments are:
See http://code.google.com/intl/en/apis/spreadsheets/docs/2.0/reference.html#CellParameters for details.
cell(\%args)
Returns Net::Google::Spreadsheets::Cell object. Arguments are:
- col
- row
batchupdate_cell(@args)
update multiple cells with a batch request. Pass a list of hash references containing:
- col
- row
- input_value
SEE ALSO
http://code.google.com/intl/en/apis/spreadsheets/docs/2.0/developers_guide_protocol.html
http://code.google.com/intl/en/apis/spreadsheets/docs/2.0/reference.html
AUTHOR
Nobuo Danjou <nobuo.danjou@gmail.com>