Hi when I use jav.io.InputStream to pass xml in subreport in 8.1.1 it returns empty pdf,
I understand the problem is the presence of namespace in xml,
I query ignoring namespace using version 8.0.2 it works perfectly, (es
<queryString language="XPath">
<![CDATA[/xml/IHead/data/row]]>
</queryString>
(xml is like <xml > <Head > <rs:data>.......</rs:data> </Head ></xml >)
Now the same value of XPath retuns no value
how do i refer to node with namespace?
thks erika
3 Answers:
this is an example,
with TEST.XML (having namespace) it return empty page in jasperserver 8.1 and 8.2 (in the previus version it works well)
with TEST2.XML (not having namespace) it returns correctly page with field printed in all versions
I assumed there was a behavior change with respect to reading namespaced fields
example: (attached xml to test)
--------------------------with namespace----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ........>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="test"/>
<parameter name="XML_INPUT_STREAM" class="java.io.InputStream">
<defaultValueExpression><![CDATA[new java.io.FileInputStream($P{FilePath})]]></defaultValueExpression>
</parameter>
<parameter name="FilePath" class="java.lang.String">
<defaultValueExpression><![CDATA["C:\\TEST.XML"]]></defaultValueExpression>
</parameter>
<queryString language="xPath">
<![CDATA[/REPORTDATA/GRID/line]]>
</queryString>
<field name="NUMBER" class="java.lang.String">
<fieldDescription><![CDATA[NUMBER]]></fieldDescription>
</field>
<field name="DESC" class="java.lang.String">
<fieldDescription><![CDATA[DESC]]></fieldDescription>
</field>
<field name="DATE" class="java.lang.String">
<fieldDescription><![CDATA[DATE]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="37" splitType="Stretch">
<textField>
<reportElement x="40" y="7" width="482" height="30" uuid="f40d2e63-f14a-4f06-b65d-45ed08a0fbc5"/>
<textFieldExpression><![CDATA[$F{DESC}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
------------------without namespace
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ........>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="test2"/>
<parameter name="XML_INPUT_STREAM" class="java.io.InputStream">
<defaultValueExpression><![CDATA[new java.io.FileInputStream($P{FilePath})]]></defaultValueExpression>
</parameter>
<parameter name="FilePath" class="java.lang.String">
<defaultValueExpression><![CDATA["C:\\TEST2.XML"]]></defaultValueExpression>
</parameter>
<queryString language="xPath">
<![CDATA[/REPORTDATA/GRID/line]]>
</queryString>
<field name="NUMBER" class="java.lang.String">
<fieldDescription><![CDATA[NUMBER]]></fieldDescription>
</field>
<field name="DESC" class="java.lang.String">
<fieldDescription><![CDATA[DESC]]></fieldDescription>
</field>
<field name="DATE" class="java.lang.String">
<fieldDescription><![CDATA[DATE]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="37" splitType="Stretch">
<textField>
<reportElement x="40" y="7" width="482" height="30" uuid="f40d2e63-f14a-4f06-b65d-45ed08a0fbc5"/>
<textFieldExpression><![CDATA[$F{DESC}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
thks erika
Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
A jrxml sample would help understand this issue.
Dear User,
We are eagerly anticipating your response to the comment mentioned above. Please provide the requested information so that we can assist you in addressing your question effectively.
this is an example,
with TEST.XML (having namespace) it return empty page in jasperserver 8.1 and 8.2 (in the previus version it works well
with TEST2.XML (not having namespace) it return page with field printed
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ........>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="test"/>
<parameter name="XML_INPUT_STREAM" class="java.io.InputStream">
<defaultValueExpression><![CDATA[new java.io.FileInputStream($P{FilePath})]]></defaultValueExpression>
</parameter>
<parameter name="FilePath" class="java.lang.String">
<defaultValueExpression><![CDATA["C:\\TEST.XML"]]></defaultValueExpression>
</parameter>
<queryString language="xPath">
<![CDATA[/REPORTDATA/GRID/line]]>
</queryString>
<field name="NUMBER" class="java.lang.String">
<fieldDescription><![CDATA[NUMBER]]></fieldDescription>
</field>
<field name="DESC" class="java.lang.String">
<fieldDescription><![CDATA[DESC]]></fieldDescription>
</field>
<field name="DATE" class="java.lang.String">
<fieldDescription><![CDATA[DATE]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="37" splitType="Stretch">
<textField>
<reportElement x="40" y="7" width="482" height="30" uuid="f40d2e63-f14a-4f06-b65d-45ed08a0fbc5"/>
<textFieldExpression><![CDATA[$F{DESC}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>