Jump to content
We've recently updated our Privacy Statement, available here ×

Table component and XML datasource


wejn45

Recommended Posts

Hello I'm using jasper 4.1.3. and I want to
fill table compomenet with data from XML datasource.

<addressbook>
    <person>
        <name>ETHAN</name>
        <phone>+1 (415) 111-1111</phone>
    </person>
  <person>
        <name>CALEB</name>
        <phone>+1 (415) 222-2222</phone>
    </person>
    <person>
        <name>WILLIAM</name>
        <phone>+1 (415) 333-3333</phone>
    </person>
</addressbook>


The resolt should be a table component looking like this

|name    |phone                      |
--------------------------------------
|Ehtan   |+1 (415) 111-1111|
|Caleb   |+1 (415) 222-2222|
|William|+1 (415) 333-3333|

Here is what i did:
1. created xml datasource
2. created new blank report
3. selected /addressbook/person/ as record node
//the following is just to create a dataset
4.a)dragged and droped table component to Title part of report
  b)selected new datasource, blank datasource, finish
5.a)selected edit query on New Dataset 1
  b)selected /addressbook/person/ as record node
  c)added name and phone fields
  d)deleted table component
//now we have a dataset
6)a) drag'n'drop table component to Title part of report
  b) create table from dataset (selected data set 1) next
  c) select both fields (name and phone), >, next
  d) use the same connection used to fill the master report
  e) next, finish

This should be it, but for preview in internal preview i get
one line (______), and in html and pdf previews i get nothing.


Does anyone know what is the problem, or an alternative way to
fill a table component with xml datasource?

xml and jrxml files are attached.
 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...