diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-26 17:54:15 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-26 17:54:15 +0000 |
commit | 9c2a0d87e96ed5301515c8c58efeda3ef98552f6 (patch) | |
tree | eb988823f03167e3ad56d50a80b80ac1ba16097b | |
parent | 1151179355b8a2ab9ed6dd3b2260e854e8a4501e (diff) |
Fixing multi-sheet output
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1671 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r-- | LedgerSMB/Template/ODS.pm | 14 | ||||
-rw-r--r-- | UI/am-list-accounts.odst | 5 |
2 files changed, 16 insertions, 3 deletions
diff --git a/LedgerSMB/Template/ODS.pm b/LedgerSMB/Template/ODS.pm index 144762e8..414e732a 100644 --- a/LedgerSMB/Template/ODS.pm +++ b/LedgerSMB/Template/ODS.pm @@ -81,8 +81,17 @@ sub preprocess { sub _worksheet_handler { $rowcount = -1; $currcol = 0; - my $sheet = $ods->getTable(0, $_->{att}->{rows}, $_->{att}->{columns}); - $ods->renameTable($sheet, $_->{att}->{name}); + my $rows = $_->{att}->{rows}; + my $columns = $_->{att}->{columns}; + $rows ||= 1000; + $columns ||= 52; + my $sheet; + if ($_->is_first_child) { + $sheet = $ods->getTable(0, $rows, $columns); + $ods->renameTable($sheet, $_->{att}->{name}); + } else { + $sheet = $ods->appendTable($_->{att}->{name}, $rows, $columns); + } } sub _row_handler { @@ -727,7 +736,6 @@ sub _format_handler { sub _format_cleanup_handler { my ($t, $format) = @_; shift @style_stack; - $t->purge; } sub _ods_process { diff --git a/UI/am-list-accounts.odst b/UI/am-list-accounts.odst index 350ea8a9..163fc054 100644 --- a/UI/am-list-accounts.odst +++ b/UI/am-list-accounts.odst @@ -38,4 +38,9 @@ </row> <?lsmb END ?> </worksheet> + <worksheet name="test2" rows='3' columns='1'> + <row><cell text='1' type='number' /></row> + <row><cell text='2' type='number' /></row> + <row><formula text='sum(A1:A2)' type='formula' /></row> + </worksheet> </workbook> |