Jump to content
JasperReports Library 7.0 is now available ×

Complex XML as XMLDataSource for crosstab creation in iReport Designer

Recommended Posts

Hello Everyone,

I googled alot to find the solution of my problem I am going to discuss here but unfortunately there is not enough examples/documents on net or may be my time is not good. Any ways here is the problem statement:

I want to use a crosstab in ireport designer and there is an xml which will act as xmldatasource.

XML Structure is:

<hydraulicCylinder id="[[DX300LC-3]]_HC-Boom" type="HydraulicCylinder" code="[[DX300LC-3]]_HC-Boom" pk="8796093120513">
<measure qualifier="bore" value="140.0" unit="mm" raw="140.0 mm">5"</measure>
<measure qualifier="lengthClosed" value="2010.0" unit="mm" raw="2010.0 mm">6' 7"</measure>
<measure qualifier="rodDiameter" value="1450.0" unit="mm" raw="1450.0 mm">4' 9"</measure>
<measure qualifier="stroke" value="95.0" unit="mm" raw="95.0 mm">3"</measure>
<hydraulicCylinder id="[[DX300LC-3]]_HC-Arm" type="HydraulicCylinder" code="[[DX300LC-3]]_HC-Arm" pk="8796093153281">
<measure qualifier="bore" value="150.0" unit="mm" raw="150.0 mm">5"</measure>
<measure qualifier="lengthClosed" value="2270.0" unit="mm" raw="2270.0 mm">7' 5"</measure>
<measure qualifier="rodDiameter" value="1670.0" unit="mm" raw="1670.0 mm">5' 5"</measure>
<measure qualifier="stroke" value="105.0" unit="mm" raw="105.0 mm">4"</measure>
There can be any no of <hydraulicCylinder> tags within </hydraulicCylinders>.Thus the column headers will be dynamic. Hydraulic cyclinder are identifies uniquely by their name as Boom, Arm so on.
Now I want to create a report which will display data as below:
Here the values of bore, length closed, rod diameter and stroke should be read from <measure> and head end cushion from <cushionHeadEnd> and rod end cushion from <cushionRodEnd> respectively, quantity from <quantity> tag.



























Rod Diameter





Length Closed





Head End Cushion





Rod End Cushion






I tried alot to achieve this but all my efforts gone in vain. I will really be thankful if someone can either guide me with steps on how i can achieve this or if possible can share the code.

Thanks in advance for all you support.

Best Wishes,

Pradeep Sharma

Link to comment
Share on other sites

  • 1 month later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

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