How to create an OO spreadsheet?

Discussion in 'Perl Misc' started by Josef Moellers, Mar 4, 2011.

  1. Hi,

    I'd like to create a small OO spreadsheet.
    Apparently the OpenOffice::OODoc module should do the trick, but I can't
    get more than a single cell, no matter whether I use the commented out
    lines or the two below them:

    #! /usr/bin/perl

    use warnings;
    use strict;
    use OpenOffice::OODoc;

    my $doc = odfDocument(
    file => "accounts.ods",
    create => 'spreadsheet',
    part => 'content',
    );
    my $sheet = $doc->normalizeSheet("Sheet1", 10, 10);
    # $doc->updateCell($sheet, 1, 1, "One Cell");
    # $doc->updateCell($sheet, 0, 0, "Another Cell");
    set($doc, 'Sheet1', 0, 0, 'One Cell');
    set($doc, 'Sheet1', 1, 1, 'Another Cell');

    $doc->save;

    exit(0);

    sub set {
    my ($doc, $sheet, $row, $col, $text) = @_;

    my $cell = $doc->getTableCell($sheet, $col, $row);
    $doc->cellValueType($cell, 'string');
    $doc->cellValue($cell, $text);
    }

    Does anyone have a hint for me?

    TIA,

    Josef
    --
    These are my personal views and not those of Fujitsu Technology Solutions!
    Josef Möllers (Pinguinpfleger bei FTS)
    If failure had no penalty success would not be a prize (T. Pratchett)
    Company Details: http://de.ts.fujitsu.com/imprint.html
    Josef Moellers, Mar 4, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    1
    Views:
    436
    Ken Cox [Microsoft MVP]
    Sep 26, 2004
  2. Tom
    Replies:
    2
    Views:
    2,867
    Hans Kesting
    Sep 24, 2004
  3. John Straumann

    Create and open Excel spreadsheet from ASP.NET

    John Straumann, Nov 10, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    1,966
    Mark Stevens
    Nov 11, 2009
  4. Tom
    Replies:
    2
    Views:
    132
    Hans Kesting
    Sep 24, 2004
  5. Tom
    Replies:
    1
    Views:
    154
    Bob Barrows [MVP]
    Sep 24, 2004
Loading...

Share This Page