Jump to content

putting parameter into field description - XML DS


biqll

Recommended Posts

Hi,

Is there any way to put a parameter (which is node number) into field description in iReport?

For example i have xml like This :

 

<Table>

<tabDescription>some Description 1<t/abDescription>

<Row>1</Row>

<Row>2</Row>

 

 <RowSum>1</RowSum>

 <RowSum>2</RowSum>

</Table>

 

<Table>

<tabDescription>some Description 2<t/abDescription>

<Row>3</Row>

<Row>4</Row>

 

 <RowSum>3</RowSum>

 <RowSum>4</RowSum>

</Table>

 

Tables are same type so i am using subreport with DataSource with selected node "/Table"

I would like to put parameter into subreport and get just one of values from 2nd node (Row, RowSum) same like values from expr. "Row[2]" and "RowSum[2]" but the XPath should be dynamic.

In Field Description i have select expression

<fieldDescription><![CDATA[/Row['"+$P{nodeNumber}+"']]]></fieldDescription>

but it show always first node.

Question is how to put properly node number from parameter into Xpath expression in Field?

 

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

I know what u mean but it's not a solution for my problem. In my case table is more complicated and fields are deep in XML structure in other locations. For example some value can occur for few years in this type - this type is representing column in table. But the other price for same year occurs in other branch of XML and its in exactly same node number like this first. In this soution i should have a template report with a lot other subreports. Every of this would have parametrized datasource and every would represent just one field. I don't want do like this.

I want to put a parameter into Field Description where is Xpath selection for this field so i could take value from this node which number is parameter

 

Link to comment
Share on other sites

  • 2 months later...

So the question is:

Is it possible to use expression (and so use $P{} or $F{} ) in the field description or description should be static only?

Dynamic description would be much, much wanted! Especially when dealing with XmlDatasource...

Link to comment
Share on other sites

andfedotov
Wrote:

So the question is:

Is it possible to use expression (and so use $P{} or $F{} ) in the field description or description should be static only?

Dynamic description would be much, much wanted! Especially when dealing with XmlDatasource...

Currently that's not supported.  It would be useful, please log it as a feature request so that we have it on our radar.

Regards,

Lucian

Link to comment
Share on other sites

  • 3 years later...

andfedotov


Wrote:
 

...

Is it possible to use expression (and so use $P{} or $F{} ) in the field description or description should be static only?...

Solution is to use  $F{} in VARIABLE description and then to use variable some times

 

Code:


Post Edited by lenalex at 08/26/2012 20:08
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...