adrish11 Posted July 30, 2012 Share Posted July 30, 2012 Hi,I am a newbie to jasper report. I want to generate the report as per the mock report i have attached.Titledata 1 titlecolumne1 column2 column3 column4data data data datadata data data data... .......... ....... .......... .... ...... .....subtotal sum sum sumdata 2 titlecolumn1 column2 column3 column4data data data datadata data data datasum sum sum sumI tried using Group and i getdata 1 titlecolumn 1 column2 column 3 column 4data 2 titlecolumn 1 column2 column 3 column4detail 1detail 2sum sum sum sumsubtotal sum sum sumI am not sure how to procede can any one please help me find a solution.Thanks Link to comment Share on other sites More sharing options...
cmatthews Posted July 31, 2012 Share Posted July 31, 2012 This is a very standard need .. Not sure what is throwing you off but I have attached a working sample with the output in PDF and the JRXML, hope this helps you.Good luck.Clark Matthews Link to comment Share on other sites More sharing options...
adrish11 Posted August 2, 2012 Author Share Posted August 2, 2012 Hi Clark,Thanks for the sample, i was trying this by adding two group bands and hence it was not working. I modified the logic of my query and used your sample to acheive the design.Thanks once again. Link to comment Share on other sites More sharing options...
cbarlow3 Posted August 2, 2012 Share Posted August 2, 2012 Adrish, I'm actually glad to see you're designing your report like that. Whenever I create groups, the first thing I do is make sure it's wide enough for my group description AND the column header labels, and I delete the standard column header band. I don't like any information to come between column header labels and the data they describe, and I think it's worth an occasional repeat of those labels if it makes the report easier to read.Two other techniques I also use every time I group that I thought I'd share with you:1. I check the "Reprint header" box property (you'll see it if you select the group header band) and I also set the "Min height to start new page" property to 80 or something like that (enough for my 40-high group header and two detail bands of 20 high each, for example), to avoid ending a page with a new group header.2. Where you have "Data 1 Title", I actually drag two copies of that into the group header band and have them overlap. That may seem odd, but here's why: first I set a "Print when expression" on each copy that is mutually exclusive and is based on the automatic count variable you get when you create a group: I make one of them be $V{GroupName_COUNT}==0 and the other be $V{GroupName_COUNT}>0. Now the first instance will display when I break from one group to another, while the other version will only print if I am continuing a group at the top of a subsquent page. Now I can make them look/behave slightly differently. I usually make the ==0 version bold and I also create a PDF bookmark for it, while the >0 version, all I do is add " (continued)" to the end of the Text Field Expression.I use these two techniques so much with groups that it's really second nature and goes by very fast now. Good luck!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