Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Net::Google::SpreadsheUser:ContributedePe:Google::Spreadsheets::Spreadsheet(3)

NAME
       Net::Google::Spreadsheets::Spreadsheet -	Representation of spreadsheet.

SYNOPSIS
	 use Net::Google::Spreadsheets;

	 my $service = Net::Google::Spreadsheets->new(
	   username => 'mygoogleaccount@example.com',
	   password => 'mypassword'
	 );

	 my @spreadsheets = $service->spreadsheets();

	 # find	a spreadsheet by key
	 my $spreadsheet = $service->spreadsheet(
	   {
	       key => 'key_of_a_spreasheet'
	   }
	 );

	 # find	a spreadsheet by title
	 my $spreadsheet_by_title = $service->spreadsheet(
	   {
	       title =>	'list for new year cards'
	   }
	 );

	 # create a worksheet
	 my $worksheet = $spreadsheet->add_worksheet(
	   {
	       title =>	'foobar',
	       col_count => 10,
	       row_count => 100,
	   }
	 );

	 # list	worksheets
	 my @ws	= $spreadsheet->worksheets;
	 # find	a worksheet
	 my $ws	= $spreadsheet->worksheet({title => 'fooba'});

	 # create a table
	 my $table = $spreadsheet->add_table(
	   {
	       title =>	'sample	table',
	       worksheet => $worksheet,
	       columns => ['id', 'username', 'mail', 'password'],
	   }
	 );

	 # list	tables
	 my @t = $spreadsheet->tables;
	 # find	a worksheet
	 my $t = $spreadsheet->table({title => 'sample table'});

METHODS
   worksheets(\%condition)
       Returns a list of Net::Google::Spreadsheets::Worksheet objects.
       Acceptable arguments are:

       o title

       o title-exact

   worksheet(\%condition)
       Returns first item of worksheets(\%condition) if	available.

   add_worksheet(\%attribuets)
       Creates new worksheet and returns a
       Net::Google::Spreadsheets::Worksheet object representing	it.  Arguments
       (all optional) are:

       o title

       o col_count

       o row_count

   tables(\%condition)
       Returns a list of Net::Google::Spreadsheets::Table objects. Acceptable
       arguments are:

       o title

       o title-exact

   table(\%condition)
       Returns first item of tables(\%condition) if available.

   add_table(\%attribuets)
       Creates new table and returns a Net::Google::Spreadsheets::Table	object
       representing it.	 Arguments are:

       o title (optional)

       o summary (optional)

       o worksheet

	 Worksheet where the table lives. worksheet instance or	the title.

       o header	(optional, default = 1)

	 Row number of header

       o start_row (optional, default =	2)

	 The index of the first	row of the data	section.

       o num_rows (optional, default = 0)

	 Number	of rows	of the data section initially made.

       o insertion_mode	(optional, default = 'overwrite')

	 Insertion mode. 'insert' inserts new row into the worksheet when
	 creating record, 'overwrite' tries to use existing rows in the
	 worksheet.

       o columns

	 Columns of the	table. you can specify them as hashref,	arrayref,
	 arrayref of hashref.

	   $ss->add_table(
	     {
		 worksheet => $ws,
		 columns => [
		     {index => 1, name => 'foo'},
		     {index => 2, name => 'bar'},
		     {index => 3, name => 'baz'},
		 ],
	     }
	   );

	   $ss->add_table(
	     {
		 worksheet => $ws,
		 columns => {
		     A => 'foo',
		     B => 'bar',
		     C => 'baz',
		 }
	     }
	   );

	   $ss->add_table(
	     {
		 worksheet => $ws,
		 columns => ['foo', 'bar', 'baz'],
	     }
	   );

	 'index' of the	first case and hash key	of the second case is column
	 index of the worksheet.  In the third case, the columns is
	 automatically placed to the columns of	the worksheet from 'A' to 'Z'
	 order.

DELETING A SPREADSHEET
       To delete a spreadsheet,	use Net::Google::DocumentsList.

	 my $docs = Net::Google::DocumentsList->new(
	   username => 'mygoogleaccount@example.com',
	   password => 'mypassword'
	 );
	 $docs->item({resource_id => 'spreadsheet:'. $ss->key})->delete;

SEE ALSO
       <https://developers.google.com/google-apps/spreadsheets/>

       Net::Google::AuthSub

       Net::Google::Spreadsheets

       Net::Google::Spreadsheets::Worksheet

       Net::Google::Spreadsheets::Table

       Net::Google::DocumentsList

AUTHOR
       Nobuo Danjou <danjou@soffritto.org>

perl v5.32.0			  201Net::Google::Spreadsheets::Spreadsheet(3)

NAME | SYNOPSIS | METHODS | DELETING A SPREADSHEET | SEE ALSO | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Net::Google::Spreadsheets::Spreadsheet&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help