2

I'm working with JODReports and I have to fill in a table in odt file from given xml. In other words I have to prepare odt template file. Hopefully someone's familiar with jodreports here and could help me out...

Here's my xml:

<?xml version="1.0" encoding="utf-8"?>
<data>

    <label>Finansavimo šaltinių klasifikatorius</label>

    <date>
        <strdate>2012-04-02</strdate>
        <strtime>15:10:05</strtime>
    </date>

    <param>
        <expdate>2012-04-02</expdate>
    </param>

    <tableconts>
        <col1name>Kodas</col1name>
        <col2name>Pavadinimas</col2name>
        <col3name>Pavadinimas dokumentuose</col3name>
        <col4name>Kodas dokumentuose</col4name>
        <col5name>Naudojamas</col5name>
    </tableconts>

    <table1>

        <values>
        <col1value1>1,</col1value1>
        <col2value2>Lietuvos Respublikos valstybės biudžetas</col2value2>
        <col3value3>-</col3value3>
        <col4value4>-</col4value4>
        <col5value5>Taip</col5value5>
        </values>

        <values>
        <col1value1>1.1</col1value1>
        <col2value2>Valstybės biudžeto lėšos</col2value2>
        <col3value3>-</col3value3>
        <col4value4>-</col4value4>
        <col5value5>Taip</col5value5>
        </values>

    </table1>

</data>

And here's my odt file(doing |[script]| to show table colums):

@table:table-row
[#list data.table1.values as items]

|${items.col1value1}|${items.col2value2}|${items.col3value3}|${items.col4value4}|${items.col5value5}|

@/table:table-row
[/#list]

Problem is this template takes all the right values from xml and prints them in the file, however they are not in the same table ! Instead of adding a row to the table it makes a completely new table. I want only one table and increase the number of rows for it each time new values are being taken from xml. I've tried manually editing contents.xml of the odt file adding [#list data.table1.values as items] before rows tags and closing with [/#items] after rows tag but it didn't bring out any success. I believe this task is a piece of cake for anyone who came across the same needs but to me it's a headache. Any help is appreciated, thanks in advance...

4

0 回答 0