I am trying to create a JasperReport using JSONDatasource that is passed by a JAVA function.
Here is my JSON that I am sending to jasper
{
"Person": {
"FirstName": "John",
"LastName": "Smith",
"Contacts": [
{
"Type": "Cell",
"Number": "555-555-5555"
},
{
"Type": "Home",
"Number": "666-666-6666"
}
]
}
}
I am trying to display the phone numbers in a table. I can display the the other fields fine. But not sure how to display the table.
Here is how I am defining my Jasper fields
<field name="FirstName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="Person.FirstName"/>
</field>
<field name="LastName" class="java.lang.String">
<<property name="net.sf.jasperreports.json.field.expression" value="Person.LastName"/>
</field>
<field name="Contacts" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="Person.Contacts"/>
</field>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…