#!/usr/bin/perl
# example2 - This program creates a SXC Calc file and uses auto-inc

use ooolib;

# Set variables
$doc = new ooolib("sxc");                   # Type of document (ie. sxc)
$doc->oooSet("builddir", ".");                   # Directory to create document in
$doc->oooSet("title", "Title - Example 2");      # Title of document
$doc->oooSet("subject", "Subject - Example 2");  # Subject of document
$doc->oooSet("comments", "Who needs comments?"); # Comments for document
$doc->oooSet("keyword", "keyword1");             # Add a keyword for the document
$doc->oooSet("keyword", "keyword2");             # Add a keyword for the document
$doc->oooSet("author", "John Doe");              # Set the author of the document
$doc->oooSet("cell-auto", 0, 1);

# User defined variables
$doc->oooSet("meta1-name", "Programmer");        # 1-4 user defined variables
$doc->oooSet("meta1-value", "Joseph Colton");    # 1-4 user defined variables

# Write the spreadsheet data

for($x=1;$x<=10;$x++) {
    $doc->oooData("cell-float", $x);
}

$filename = $doc->oooGenerate; # Create the document and return a filename

print "$filename\n";

exit;
