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

List of Values As String as Field Value


keithrbennett

Recommended Posts

Hi, everyone.  I have something like this in the XML file that I'm using as my data source:

<reportItems>  <reportItem>    <fruits>      <fruit>apple</fruit>      <fruit>orange</fruit>    </fruits>  </reportItem></reportItems>

I'd like to use a Groovy expression to join them into a single string which will be used as the string value of one "Fruits" field:

groovy:000> ["apple", "orange"].join(', ')

===> apple, orange

This report (actually a subreport) is listing the reportItem's, so the fruits field would be repeated once per reportItem. Is there any way I can do this? Is there an XPath expression that will return a Java or Groovy array or list? Can a field contain an XPath query as part of its expression? Thanks for any help.

- Keith



Post Edited by keithrbennett at 06/11/2010 23:06



Post Edited by keithrbennett at 06/11/2010 23:07
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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