iReport problems

F

Francesco

Hello all,
I'm new in iReport. I have seen a tutorial to use iReport from an XML
Datasource:
http://jasperforge.org/sf/wiki/do/viewPage/projects.ireport/wiki/UsingTheXMLDatasource

The xml that I have tested in iReport is addressbook.xml

The Record path is: /addressbook/category/person

<addressbook>
<category name="home">
<person id="1">

<LASTNAME>Davolio</LASTNAME>
<FIRSTNAME>Nancy</FIRSTNAME>
<hobbies>
<hobby>Radio Control</hobby>
<hobby>R/C Cars</hobby>
</hobbies>
<email>[email protected]</email>
<email>[email protected]</email>
</person>
<person id="2">
<LASTNAME>Fuller</LASTNAME>
<FIRSTNAME>Andrew</FIRSTNAME>
<email>[email protected]</email>
<email>[email protected]</email>
</person>
</category>
<category name="work">
<person id="4">

<LASTNAME>Peacock</LASTNAME>
<FIRSTNAME>Margaret</FIRSTNAME>
<hobbies>
<hobby>Toy Horse</hobby>
</hobbies>
<email>[email protected]</email>
</person>
</category>
</addressbook>

I have tried the example and all works. Then, I have changed the xml
adding a different tag on the same level of the tag category,for
example :

<addressbook>
<authors>
<author>John XXX</author>
<author>John XXX</author>
</authors>
<category name="home">
<person id="1">

<LASTNAME>Davolio</LASTNAME>
<FIRSTNAME>Nancy</FIRSTNAME>
<hobbies>
<hobby>Radio Control</hobby>
<hobby>R/C Cars</hobby>
</hobbies>
<email>[email protected]</email>
<email>[email protected]</email>
</person>
<person id="2">
<LASTNAME>Fuller</LASTNAME>
<FIRSTNAME>Andrew</FIRSTNAME>
<email>[email protected]</email>
<email>[email protected]</email>
</person>
</category>
</addressbook>

and when iReport create the PDF document I see the value null in the
cycle of the tags category. Seems that iReport doesn't read exactly
only the path /addressbook/category/person but read even the tag
authors that is not correct!!

I can I solve this problem???

Than, the last question :

in the first example of xml addressbook the category tag has the
attribute "name".
If I want only show the categories that have name="work", how can I do
in iReport??

Thanks for all your response,
Francesco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top