Adding multiple dynamic tables in Jaspersoft Studio 6.0.1

0

Hi,


I try to create a new report. But this report must be very dynamic and I'm not sure if I can do this via Jasper. The big issues are some tables that have different numbers of columns und different numbers of rows. And the number of tables itself does also vary from report to report.

How I get the data: I start from a XML file that looks like this.

<TestReport>
  <FeatureTable>
    <Row header="true">
      <Cell>Feature</Cell>
      <Cell>Nominal value/Tolerance</Cell>
      <Cell>Actual value</Cell>
    </Row>
    <Row>
      <Cell>Feature #1</Cell>
      <Cell>OK</Cell>
      <Cell>OK</Cell>
    </Row>
    <Row>
      <Cell>Feature #2</Cell>
      <Cell></Cell>
      <Cell>OK</Cell>
    </Row>
    <Row>
      <Cell>Feature #3</Cell>
      <Cell>196.00 mm</Cell>
      <Cell>OK</Cell>
    </Row>
  </FeatureTable>
  <Appendix>
    <Table>
      <Row header="true">
        <Cell width="60">any value</Cell>
      </Row>
      <Row>
        <Cell width="30">Maximum</Cell>
        <Cell width="30">20.58 Nm</Cell>
      </Row>
      <Row>
        <Cell width="30">Minimum</Cell>
        <Cell width="30">11.40 Nm</Cell>
      </Row>
    </Table>
    <Table>
      <Row header="true">
        <Cell width="60">any value</Cell>
      </Row>
      <Row>
        <Cell width="30">Maximum</Cell>
        <Cell width="30">22.59 Nm</Cell>
      </Row>
      <Row>
        <Cell width="30">Minimum</Cell>
        <Cell width="30">10.90 Nm</Cell>
      </Row>
      <Row>
        <Cell width="30">Average</Cell>
        <Cell width="30">15.08 Nm</Cell>
      </Row>
    </Table>
  </Appendix>
</TestReport>

 

Now how can I add a data adapter that give me the values in fields and how can I build my tables?

I have tried a csv data adapter but then I'm losing the rows information and all the cells are mixed up.

I have tried a xml data adapter but I cannot create an xpath that give me multiple rows and multiple cells inside.

And I also tried to add two tables with 'Print Repeated Values' but then I get:

table_1_row_1

table_2_row_1

table_1_row_2

...

 

Any ideas?

d.rossmann's picture
Joined: Apr 16 2019 - 1:58am
Last seen: 1 month 1 day ago

0 Answers:

No answers yet
Feedback