NAME

OpenOffice::OOCBuilder - Perl OO interface for creating OpenOffice Spreadsheets


SYNOPSIS

  use OpenOffice::OOCBuilder;
  $sheet=OpenOffice::OOCBuilder->new();
  This constructor will call the constructor of OOBuilder.


DESCRIPTION

OOCBuilder is a Perl OO interface to create OpenOffice spreadsheets. Documents can be created with multiple sheets, different styles, cell types, formulas, column widths and so on.


METHODS

new

  Create a new spreadsheet object

add_sheet

  Add a new sheet within the document. Active sheet is not changed. 
  You need to call goto_sheet (sheetnumber) to change the active 
  sheet.

goto_sheet ($sheetnumber)

  Set $sheetnumber as active sheet.

set_sheet_name ($name, $sheetnumber)

  Set the name of the sheet. If $sheetnumber is ommitted (or 0), the 
  name of the active sheet is set.

set_colwidth ($c, $width)

  Set the column width for the specified column ($c). The column can 
  be a number or letter(s).

set_rowheight ($r, $height)

  Set the row height for the specified row ($r).

goto_xy ($c, $r)

  Set the active cell to ($c, $r). The column can be specified by 
  number or letter(s).

goto_cell ($cell_id)

  Set the active cell to ($cell_id). This way you can use spreadsheet
  notations (i.e. A5 or BA401 and so on)

get_column

  Returns the active column in letters.

get_x

  Returns the active column as a number (starting at 1).

get_row

  Returns the row as a number (starting at 1)

get_y

  Returns the row as a number (starting at 1). Same as get_row.

get_xy

  Returns the column and row as two numbers in a list.

get_cell_id

  Returns the cell id in the form A1, AB564, and so on. Especially handy
  to create formulas. When you are at the start position, memorise the 
  cell_id. See example2.pl in the examples directory.

set_data ($data, $type, $format)

  Set data in the active cell within the active sheet. If type is ommitted
  the standard type is taken. $format is not yet implemented, can still 
  change.

set_data_xy ($c, $r, $data, $type, $format)

  Same as set_data, but now with column and row to set the data in. The 
  column can be specified as a number or with letter(s). $format is not
  yet implemented, can still change.

set_data_sheet_xy ($sheet, $c, $r, $data, $type, $format)

  Same as set_data, but now with sheet, column and row to set the data in.
  The column can be specified as a number or with letter(s). $format is not
  yet implemented, can still change.

set_auto_xy ($x, $y)

  When entering data in a cell, we move to another cell if auto_x or y
  is set.
   X value: 0: no movement, negative: move left, positive: move right.
   Y valye: 0: no movement, negative: move up, positive: move down.

get_auto_x

  Returns the auto_x value.

get_auto_y

  Returns the auto_y value.

cell_update

  This method is called always when entering data in a cell. If auto_x
  or auto_y is set, if will move to another active cell. You can also 
  use this method to move to another cell without entering data in the
  previous cell.

move_cell ($direction, $number)

  Move to cell in $direction where $direction is 'left', 'right', 'up' or
  'down'. If you ommit $number, the move will be one row or column.

generate ($tgtfile)

  Generates the sxc file. $tgtfile is the name of the target file without
  extension. If no name is supplied, the default name will be used,
  which is oo_doc. The target directory is '.', you can set this by 
  calling the OOBuilder method set_builddir ($builddir).

Setting the style and meta data

  See OpenOffice::OOBuilder, because these methods are directly 
  inherited from the base class.


EXAMPLES

Look at the examples directory supplied together with this distribution.


SEE ALSO

man OOBuilder - the base class

http://www.maygill.com/oobuilder

Bug reports and questions can be sent to . Attention: make sure the word is in the subject or body of your e-mail. Otherwhise your e-mail will be taken as spam and will not be read.


AUTHOR

Stefan Loones


COPYRIGHT AND LICENSE

Copyright 2004, 2005 by Stefan Loones

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