asder99 Posted October 13, 2010 Share Posted October 13, 2010 Hi!I need an help.My query result is like that: ID CAT ITEM 1 A fork 2 A spoon 3 B chair And I need a report that join one or more records by CAT.Something like: A fork spoon B chair So I think I have compare the record result with the previuos one, and if it's the same, I have to hide the CAT's text area.But the question is: how can I call the previous record? Thanks a lot! Link to comment Share on other sites More sharing options...
Gaby38 Posted October 13, 2010 Share Posted October 13, 2010 You have to group your records else in the sql query else by using the "group" functionnality of jasperreport Link to comment Share on other sites More sharing options...
pwd Posted October 13, 2010 Share Posted October 13, 2010 EDIT: The previous poster beat me to it. Can you group by CAT? If you can just put CAT in the group band. Or do you need your report to look exactly like you described?Post Edited by pwd at 10/13/2010 19:07 Link to comment Share on other sites More sharing options...
asder99 Posted October 13, 2010 Author Share Posted October 13, 2010 I think you don't mean the function "group by" of mysql... can you explain me?Have you got any link to a tutorial or a guide? Thanks a lot! Link to comment Share on other sites More sharing options...
asder99 Posted October 14, 2010 Author Share Posted October 14, 2010 Well... going in "trial mode", after a pair of hours I found a way.I create a new report and in the wizard, in the 5th step, I grouped the results for "CAT". In the "Report Inspector" menu there's a new type of band to create: CAT Group Header.I create it and I put the CAT field in that band, and the rest in the band "Details". Unfortunatly I didn't find a way to modify an existing report to add the group as I do in the wizard. Hi all and thanks for the hint! Link to comment Share on other sites More sharing options...
Gaby38 Posted October 14, 2010 Share Posted October 14, 2010 My previous advice about doing by sql was not the better! In fact, the simpliest way was to use the grouping function of jasperreport. It is what the wizard did : it created a group.To access to group functions inside iReport, you have to go to Report Inspector window and right click on the report object at the top of the window. Link to comment Share on other sites More sharing options...
cbarlow3 Posted October 15, 2010 Share Posted October 15, 2010 Coincidentally, I just created some similar output this morning. I didn't use a wizard, though:I original had $V{LastFirst} and some other fields in the Detail 1 band. I have multiple rows that might have the same value for $V{LastFirst}, and I didn't want to repeat that Last/First name until I got to a new one. In the Report Inspector pane in the Detail 1 section, I selected (left clicked) on $V{LastFirst} and then right clicked on it and selected "Group Selected Element(s)". Frankly, that didn't help much as far as suppressing repeat values (my output is already in the order I want, by the way). The easiest way, with or without grouping is to select the item that you want to suppress repeats on (under Detail 1 in the report inspector or right in the design pane) and then in the Properties pane, uncheck the "Print Repeated Values" checkbox!Carl 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