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

Multiple List Components


gerch123

Recommended Posts

 Hey guys

so i am using javabeans as my data source and each bean has a couple of properties of which are some addresses...

 

so for example i have a person.java class that has

   - name

   - age

   - List<Address> addressess

   - List<Phone> phoneNumbers

 

so now i wanna print the name,age, all the addresses and all the phones... i am using for that the list component and it works perfectly fine.. 

i create a subdataset for addresses and for phone numbers and attach each of them to one list. 

i tested it first with addresses and all of them print out smoothly... 

now i added the phone numbers in exactly the same way and they also print perfectly but now the addresses dont show up anymore.

has anyone ever run into this issue? any help appriciated... i can post code if needed

Code:
<field name="notes" class="java.util.List">	<fieldDescription><![CDATA[addresses]]></fieldDescription></field><field name="notes" class="java.util.List">	<fieldDescription><![CDATA[phoneNumbers]]></fieldDescription></field><componentElement>				<reportElement x="0" y="268" width="555" height="66" isPrintWhenDetailOverflows="true"/>				<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">					<datasetRun subDataset="addresses">						<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{addresses})]]></dataSourceExpression>					</datasetRun>					<jr:listContents height="66" width="555">						...					</jr:listContents>				</jr:list>			</componentElement>
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

 i found the problem ...

 

seems like when you have a list component anything else below or above it doesnt really get displayed... does anyone know how to change that?

 

so that if the first list has 10 elements the second list will be pushed down

 

Thanks

Chris 

Link to comment
Share on other sites

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