Jump to content
We've recently updated our Privacy Statement, available here ×

Subreport with XML-Datasource


gombs

Recommended Posts

High,

 

I have an Subreport from an XML-Source, it works alone without problems. But when I insert this as a Subreport to an other Report I become this message:

 

1286293 [mv_atos_part subreport filler] WARN query.JRXPathQueryExecuter - The supplied org.w3c.dom.Document object is null.

 

The Parentreport have the same XML-Source ( only an other XPATH Expression ) I have the option selected that the XPath expression from report should be used.

 

What is going wrong?

 

friendly greets to all other iReport-users

Link to comment
Share on other sites

  • Replies 15
  • Created
  • Last Reply

Top Posters In This Topic

there are 2 things you need to set when u add a subreport to a main.

 

1) the subreport connection expression. ie

 

((net.sf.jasperreports.engine.data.JRXmlDataSource) $P{REPORT_DATA_SOURCE}).dataSource("/Myxml/Data[Foo != '']")

 

NOTE the Xpath, this needs to point at your data.

 

2) the subreport expression. ie

 

"MySubreport.jasper"

 

This is the name of the compiled jasper subreport.

 

luck

walmillard

Link to comment
Share on other sites

I use the wizard.

 

to 1)

 

The connection is the same like parentreport ( "$P{REPORT_CONNECTION}" ) .

 

The XPath from subreport is "/root/ATOS/Measure". It is valid, because as alone report it works fine, only not as a subreport.

 

To 2) The subreportexpression is valid to, i've selected from File-Browser and in all other cases it works.("mv_atos_part.jasper") I don't know whats the Problem....

 

:blush:

Link to comment
Share on other sites

This is the XML-Data-Source:

 

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

<root>

<ATOS>

<Atos-System-Typ>ATOS III Rev. 01</Atos-System-Typ>

<SNR-Sensor>D 06 043</SNR-Sensor>

<SN_ATOS_KameraLinks>181824506</SN_ATOS_KameraLinks>

<SN_ATOS_KameraRechts>185524706</SN_ATOS_KameraRechts>

<Measure id="1">

<Measuring_Volume>300x300</Measuring_Volume>

<Lens_Focal_MeasuringVolume_atos_Projektiv>12mm</Lens_Focal_MeasuringVolume_atos_Projektiv>

<Lens_Focal_MeasuringVolume_atos_ObjektivLinks>35mm</Lens_Focal_MeasuringVolume_atos_ObjektivLinks>

</Measure>

<Measure id="2">

<Measuring_Volume>150x150</Measuring_Volume>

<Lens_Focal_MeasuringVolume_atos_Projektiv>23mm</Lens_Focal_MeasuringVolume_atos_Projektiv>

<Lens_Focal_MeasuringVolume_atos_ObjektivLinks>65mm</Lens_Focal_MeasuringVolume_atos_ObjektivLinks>

</Measure>

 

<Profil>CFK 400</Profil>

 

<Typ>ROT640</Typ>

 

<Stativ_ATOS_Stativ>Foba AROBI</Stativ_ATOS_Stativ>

<High_ATOS_Stativ>2,0m</High_ATOS_Stativ>

<Arm0_ATOS_Stativ>1,7m</Arm0_ATOS_Stativ>

<Arm1_ATOS_Stativ>1,0m</Arm1_ATOS_Stativ>

</ATOS>

Link to comment
Share on other sites

Post edited by: gombs, at: 2007/01/31 07:06

 

if I used the connection expression like this the subreport will empty too, but there are no message like my first post ((net.sf.jasperreports.engine.data.JRXmlDataSource) $P{REPORT_DATA_SOURCE}).dataSource("/users//templates/test.xml")

 

help plz :(

Post edited by: gombs, at: 2007/01/31 07:13

Link to comment
Share on other sites

Maybe it is a general bug?

 

I had create a simple report with a simple XML-file as datasource and a parentreport where this report was insert and there was the same problem...the parentreport use the same data source, too:S

Link to comment
Share on other sites

Ok in iReport it works fine.

But in a java app I get following error:

 

Error evaluating expression :

Source text : ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/root/ARGUS")

 

What is wrong?

Link to comment
Share on other sites

  • 3 months later...

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