Gemma3004 Posted November 13, 2021 Share Posted November 13, 2021 Hi, I am using Jasper Studio with an XML data source.I would like to know how to amalgamate the questionId field (when the field appears on multiple rows as shown below) into a comma separated string so it can appear on my report as "1,2,3"rather than on separate lines like123Can I amalgamte into a string via a variable?Here is how my xml dataset looks like:<Answer Category="xxxx" Id="xxxxxx" questionId="1"><Answer Category="xxxx" Id="xxxxxx" questionId="2"><Answer Category="xxxx" Id="xxxxxx" questionId="3">Please help as I have a deadline to meet and I am really struggling.Thank you Link to comment Share on other sites More sharing options...
Gemma3004 Posted November 13, 2021 Author Share Posted November 13, 2021 Please can someone help? Link to comment Share on other sites More sharing options...
zellers Posted November 16, 2021 Share Posted November 16, 2021 Add a variable with calculation set to "System", Expression:$V{Variable_1} != null ? $V{Variable_1} + "," + $F{questionId} : $F{questionId}.toString()[/code]And Evaluation time on the Text Field to "Report". Demo attached. 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