claire.chanmyae Posted November 18, 2014 Share Posted November 18, 2014 HI,I'm newbie to jaspersoft studio. I would like to generate a report with two group. Pass & Fail. There are three grades which are A,B, and C. I would like to group grade A & B as Pass group and C as Fail group.How do I populate such group report?Thank you in advanced. Link to comment Share on other sites More sharing options...
Massimo Rabbi Posted November 21, 2014 Share Posted November 21, 2014 Hi,supposing you can not properly fix/modify your query in order to have an additional field suitable for group creation, you could create a group based upon an expression. In there you will have something like the following ternary expression:"A".equals($F{GRADE_VAL}) || "B".equals($F{GRADE_VAL}) ? "PASS GROUP" : "FAIL GROUP"In this way you will end up splitting your data depending on this criteria. Graphically this will be printed out if you are able to properly order your data depending on the GRADE_VAL field.If you are not able to do so, try to create also a variable and use the same expression. After create a sort field based upon that variable.That's all.Regards,Massimo.P.S: you find attached two samples using the SampleDB connection. We want to group the orders in two groups: "AUSTRIA_AND_ARGENTINA" and "ALL_OTHERS". The first example exploits the fact that the data produced are already ordered (Austria and Argentina are the first countries). The second one relies on the usage of the sort field. If you notice, they have two different queries. 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