olehenrik Posted March 1, 2007 Share Posted March 1, 2007 Hi, I have problem, or havent found a solution how to fetch one value/field from a query which return several rows. Example - The query is like this item_code value1 A2 B3 C4 D5 E I would like to use all of this values in the same band in a sentence, how can I do that? Is there a expression that can be used?Yes I can rewrite the query so it only return one row with all the values, but it's not a good solution --> runtime would go up. Link to comment Share on other sites More sharing options...
rharis Posted March 3, 2007 Share Posted March 3, 2007 olehenrik wrote:Hi,I have problem, or havent found a solution how to fetch one value/field from a query which return several rows.Example - The query is like thisitem_code value1 A2 B3 C4 D5 EI would like to use all of this values in the same band in a sentence, how can I do that? Is there a expression that can be used?Yes I can rewrite the query so it only return one row with all the values, but it's not a good solution --> runtime would go up. Link to comment Share on other sites More sharing options...
Echo Posted March 3, 2007 Share Posted March 3, 2007 Run the query in a subreport. In the subreport concatenate the strings together to form a single string and return that as a return value from the subreport. You will need to use a variable to do this, using a variable calculation value like ($V{Variable} == null) ? $P{FieldValue} : $V{Variable} + $F{FieldValue} I have attached a sample jrxml subreport that I use ina similar situation. Take a look at how the SerialNumber variable is being calculated. Echo [file name=subPackingListSerial.jrxml size=10233]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/subPackingListSerial.jrxml[/file]Post edited by: Echo, at: 2007/03/02 22:36 Link to comment Share on other sites More sharing options...
olehenrik Posted March 6, 2007 Author Share Posted March 6, 2007 Ok, I'll give it a shot.Thanks for the help! RegardsOle H 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