Jump to content

iReport problem


2006 IR Open Discussion

Recommended Posts

By: Francesco - francesco334

iReport problem

2006-09-11 08:22

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>email1@my.domain.it</email>

<email>email2@my.domain2.it</email>

</person>

<person id="2">

<LASTNAME>Fuller</LASTNAME>

<FIRSTNAME>Andrew</FIRSTNAME>

<email>email3@my.domain3.it</email>

<email>email4@my.domain4.it</email>

</person>

</category>

<category name="work">

<person id="4">

<LASTNAME>Peacock</LASTNAME>

<FIRSTNAME>Margaret</FIRSTNAME>

<hobbies>

<hobby>Toy Horse</hobby>

</hobbies>

<email>Peacock@margaret.com</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>email1@my.domain.it</email>

<email>email2@my.domain2.it</email>

</person>

<person id="2">

<LASTNAME>Fuller</LASTNAME>

<FIRSTNAME>Andrew</FIRSTNAME>

<email>email3@my.domain3.it</email>

<email>email4@my.domain4.it</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

 

 

 

$P{SUBREPORT_DIR} +

 

new Boolean($V{CATEGORYTYPE}=="home")

 

.getValue()

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...