erika.chinchio Posted June 1, 2023 Share Posted June 1, 2023 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 valuehow do i refer to node with namespace?thks erika Link to comment Share on other sites More sharing options...
Mehak Rajkumar Posted June 1, 2023 Share Posted June 1, 2023 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. Link to comment Share on other sites More sharing options...
Scott Andersen Posted June 1, 2023 Share Posted June 1, 2023 A jrxml sample would help understand this issue. Link to comment Share on other sites More sharing options...
anish.rai Posted June 5, 2023 Share Posted June 5, 2023 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. Link to comment Share on other sites More sharing options...
erika.chinchio Posted June 7, 2023 Author Share Posted June 7, 2023 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 wellwith 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> Link to comment Share on other sites More sharing options...
erika.chinchio Posted June 7, 2023 Author Share Posted June 7, 2023 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 versionsI assumed there was a behavior change with respect to reading namespaced fieldsexample: (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 Link to comment Share on other sites More sharing options...
Scott Andersen Posted June 7, 2023 Share Posted June 7, 2023 I notice 2 things- in the namespace version of the xml you have not defined the namespaces.- In Studio when defining the xml adapter, is the "Enable namespaces support" checkbox marked? Link to comment Share on other sites More sharing options...
erika.chinchio Posted June 8, 2023 Author Share Posted June 8, 2023 thks for your replay but I try to define namespace and marked "enable namespaces support" in adapter, but in jasperserver I see pdf empty,in the previuos version of jasper the same example works wellthks erika 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