kjhuebner Posted October 2, 2006 Share Posted October 2, 2006 When I export a JasperPrint object as XML the order of data is mixed up. That is, the table "Heading" data appears AFTER the "content" data. And the Title appears AFTER a heading. Yet these things are in the proper order when the very same JasperPrint object is exported as HTML. As a result the XML data is unusable since I was planning to parse this data--separating it into column heading data followed by content. Is there any solution to this significant issue? Thanks!Ken XML Data...Code: <text textHeight="13.798828" lineSpacingFactor="1.1499023" leadingOffset="-2.3466797"> <reportElement mode="Opaque" x="29" y="203" width="135" height="20"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" leftPadding="5" bottomBorder="None" bottomBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000"/> <textContent><![CDATA[1010322000]]></textContent> </text> <text textHeight="13.798828" lineSpacingFactor="1.1499023" leadingOffset="-2.3466797"> <reportElement mode="Opaque" x="164" y="203" width="186" height="20"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" leftPadding="10" bottomBorder="None" bottomBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000"/> <textContent><![CDATA[0]]></textContent> </text> <text textHeight="13.798828" lineSpacingFactor="1.1499023" leadingOffset="-2.3466797"> <reportElement x="350" y="203" width="201" height="20"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" leftPadding="10" bottomBorder="None" bottomBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000"/> <textContent><![CDATA[13]]></textContent> </text> <text textAlignment="Left" verticalAlignment="Top" textHeight="15.09375" rotation="None" lineSpacing="Single" lineSpacingFactor="1.2578125" leadingOffset="-2.6367188"> <reportElement mode="Opaque" x="29" y="186" width="135" height="17" forecolor="#FFFFFF" backcolor="#3366FF"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" leftPadding="5" bottomBorder="None" bottomBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000"/> <font fontName="Helvetica" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="CP1252" isPdfEmbedded="false"/> <textContent><![CDATA[item Id]]></textContent> </text> <text textAlignment="Left" verticalAlignment="Top" textHeight="15.09375" rotation="None" lineSpacing="Single" lineSpacingFactor="1.2578125" leadingOffset="-2.6367188"> <reportElement mode="Opaque" x="164" y="186" width="186" height="17" forecolor="#FFFFFF" backcolor="#3366FF"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" leftPadding="5" bottomBorder="None" bottomBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000"/> <font fontName="Helvetica" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="CP1252" isPdfEmbedded="false"/> <textContent><![CDATA[inbound Qty]]></textContent> </text> <text textAlignment="Left" verticalAlignment="Top" textHeight="15.09375" rotation="None" lineSpacing="Single" lineSpacingFactor="1.2578125" leadingOffset="-2.6367188"> <reportElement mode="Opaque" x="350" y="186" width="201" height="17" forecolor="#FFFFFF" backcolor="#3366FF"/> <box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" leftPadding="5" bottomBorder="None" bottomBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000"/> <font fontName="Helvetica" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="CP1252" isPdfEmbedded="false"/> <textContent><![CDATA[OutboundQty]]></textContent> </text> HTML Data...Code:[code]<tr valign="top"> <td><img alt="" src="px" style="width: 29px; height: 17px"/></td> <td colspan="7" style="background-color: #3366FF; border-left-style: solid; border-left-width: 1px; border-left-color: #000000; padding-left: 5px; border-right-style: solid; border-right-width: 1px; border-right-color: #000000; "><span style="font-family: Helvetica; color: #FFFFFF; background-color: #3366FF; font-size: 12.0px; font-weight: bold;">Item Id</span></td> <td colspan="8" style="background-color: #3366FF; border-left-style: solid; border-left-width: 1px; border-left-color: #000000; padding-left: 5px; border-right-style: solid; border-right-width: 1px; border-right-color: #000000; "><span style="font-family: Helvetica; color: #FFFFFF; background-color: #3366FF; font-size: 12.0px; font-weight: bold;">Inbound Qty</span></td> <td colspan="12" style="background-color: #3366FF; border-left-style: solid; border-left-width: 1px; border-left-color: #000000; padding-left: 5px; border-right-style: solid; border-right-width: 1px; border-right-color: #000000; "><span style="font-family: Helvetica; color: #FFFFFF; background-color: #3366FF; font-size: 12.0px; font-weight: bold;">OutboundQty</span></td> <td><img alt="" src="px" style="width: 44px; height: 17px"/></td></tr><tr valign="top"> <td><img alt="" src="px" style="width: 29px; height: 20px"/></td> <td colspan="7" style="border-left-style: solid; border-left-width: 1px; border-left-color: #000000; padding-left: 5px; border-right-style: solid; border-right-width: 1px; border-right-color: #000000; "><span style="font-family: Arial; background-color: #FFFFFF; font-size: 12.0px;">1010322000</span></td> <td colspan="8" style="border-left-style: solid; border-left-width: 1px; border-left-color: #000000; padding-left: 10px; border-right-style: solid; border-right-width: 1px; border-right-color: #000000; "><span style="font-family: Arial; background-color: #FFFFFF; font-size: 12.0px;">0</span></td> <td colspan="12" style="border-left-style: solid; border-left-width: 1px; border-left-color: #000000; padding-left: 10px; border-right-style: solid; border-right-width: 1px; border-right-color: #000000; "><span style="font-family: Arial; font-size: 12.0px;">13</span></td> <td><img alt="" src="px" style="width: 44px; height: 20px"/></td></tr> Link to comment Share on other sites More sharing options...
Teodor Danciu Posted October 2, 2006 Share Posted October 2, 2006 Hi, It would be useful if you could post the corresponding portion of JRXML too. Thank you,Teodor Link to comment Share on other sites More sharing options...
kjhuebner Posted October 3, 2006 Author Share Posted October 3, 2006 Hi Teodor,Here's the jrxml files that were used to generate the xml and html. I also included the full xml and html output for viewing. The output is generated from a master report containing two subreports using custom data sources. (The HTML is rendered in a Swing application, so note that if you have IE render the included html, you'll see some vertical spaces between data.) But again, the HTML ordering is correct. The XML ordering is not. Thanks,Ken [file name=2006_10_2_xmlOrderingBad_withHTML.zip size=29786]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/2006_10_2_xmlOrderingBad_withHTML.zip[/file] Link to comment Share on other sites More sharing options...
Teodor Danciu Posted October 3, 2006 Share Posted October 3, 2006 Hi, The order in which elements appear in XML format corresponds to the order in which the elements were rendered during the report filling process, when the current page was constructed.The renderind order corresponds to the order in which the elements were declared in JRXML. If you use iReport, you'll see that in the view that shows the content of the band, your column header elements appear after the table row elements. Change the order there and the order will change also the the final XML export. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now