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

Subreport und XPath


cHaOs667

Recommended Posts

Hello,

 

i have one Mainreport and one Subreport. Those two point s to one XML File which looks like:

Code:

<aaa id="1">
<bbb id="1">
<ccc>abc</ccc>
</bbb>
<bbb id="2">
<ccc>abc</ccc>
</bbb>
<ddd>cba</ddd>
</aaa>
<aaa id="2">
<bbb id="1">
<ccc>abc</ccc>
</bbb>
<ddd>cba</ddd>
</aaa>

 

My Mainreport ist targetting to /aaa and my Subreport to /aaa/bbb.

 

And there is my problem, the subreports prints the values of all <ccc> fields found in the xml file and not only for the first <aaa> entry.

 

In my opinion it should print at first the first <aaa> entry, then the fields unter <bbb> for the actual position and then the values stored in the <ddd> field.

 

Many thanks in advance

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hallo,

I hope I understood your question.

In my opinion your subreport XPath i.e /aaa/bbb will print the values of <ccc>

if you want to print the values of<ddd> I would suggest just use another subreport.

About printing the first <aaa> entry I didn't understand what you meant.

I hope this will help.

 

Regards

Fatsy

Link to comment
Share on other sites

Hallo,

I hope I understood your question.

In my opinion your subreport XPath i.e /aaa/bbb will print the values of <ccc>

if you want to print the values of<ddd> I would suggest just use another subreport.

About printing the first <aaa> entry I didn't understand what you meant.

I hope this will help.

 

Regards

Fatsy

Link to comment
Share on other sites

  • 2 weeks later...

@fatsy: Thanks for you answers.

 

But i think i haven't explained my problem very well.

 

My problem is that my Mainreport should print all Values under /aaa and the subreport should print all values under /aaa/bbb but my Report only prints the Values found under the first /aaa Elements (i mean all elements found under /aaa with the id=1) and the Subreport prints all Values found in the xml file for ccc (not only those belonging to aaa with id=1, it prints ervery elements!).

 

Here i list my problem clearer:

Mainreport: Prints only the Elements found under /aaa (id=1)

Subreport: Prints all ccc elements (it doesn't care of if those elements are under aaa with id=1 or id=2 but i want that the Subreport only prints the elements belonging to the id in the Mainreport.)

 

Meinreport XPath Value: /aaa

Subreport XPath Value: /aaa/bbb

Link to comment
Share on other sites

if you want your xml path query to search thru all the aaa then it should look like this

 

MainReport XPath Value: //aaa (this will return all aaa)

 

SubReport XPath Value: //aaa[@id=$P{idParameter}]//bbb (you must provide a parameter to your subreport this will then only return ccc where aaa @id = to the parameter you pass. you can also set a range for the id value.)

 

I hope this helps

 

cheers

Link to comment
Share on other sites

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