sunnyramon Posted February 7, 2011 Share Posted February 7, 2011 I have couple of lines of text that must be printed above the <detail> section (i.e. under the regular <title> and <pageHearder> section) and only on the first page. My currently solution is to place the text as the bottom part of the <pageHearder> and use printWhenExpression(PAGE_NUMBER = 1) to make them only appear on the first page. This solution works fine for the first page but the problem is that for the rest of pages the space that is reserved for the text become an ugly blank block. Is there some way to make the report engine dynamically and automatically adjust the height of a band to eliminate the blank blocks when not all its contents get printed? Or there are other ways to solve problem? I searched the web and found this post asked almost exactly the same question as mine but the solution in its reply does not work. Link to comment Share on other sites More sharing options...
shertage Posted February 7, 2011 Share Posted February 7, 2011 If the report is a single-column layout (ie. columnCount = 1), you could use the <columnHeader/> section for those couple of lines only.HTH,sanda Code: Post Edited by shertage at 02/07/2011 19:14 Link to comment Share on other sites More sharing options...
sunnyramon Posted February 7, 2011 Author Share Posted February 7, 2011 Sanda, Thanks for your suggestion. Unfortunately my report has multiple columns. I don't understand why jasper uses so static band height. If it could support something like height="*" to indicate the height is as mush as needed that would be great.Post Edited by sunnyramon at 02/07/2011 19:26 Link to comment Share on other sites More sharing options...
shertage Posted February 7, 2011 Share Posted February 7, 2011 Yes, dynamic values for attributes are still a problem, indeed. But not the variable band height. It can be solved with stretch attributes. ensure that splitType attribute of the pageHeader is set to "Stretch" put all text that needs to be printed on the first page only in one or more textfields having isStretchWithOverflow="true", and height="1" (this height will be dinamically increased at fill time) for textfields at point 2, write the printWhenExpression too calculate your pageHeader band height considering that the textfields at point 2 have exactly height="1"I think that this should solve the problem.Please also to consult the stretch sample in order to find out more about how to combine a series of stretch attributes in order to get the optimum report layout.HTH,sanda Post Edited by shertage at 02/07/2011 20:50 Link to comment Share on other sites More sharing options...
sunnyramon Posted February 8, 2011 Author Share Posted February 8, 2011 Sanda,Your solution works great. Thanks a lot.SunnyPost Edited by sunnyramon at 02/08/2011 22:53 Link to comment Share on other sites More sharing options...
pedrera_j Posted June 27, 2012 Share Posted June 27, 2012 Thanks.It works fine if you want to adjust the <pageHeader> but doesn't work in the <columnFooter> or <pageFooter>.Are there any solution¿? Link to comment Share on other sites More sharing options...
ibradien Posted June 14, 2013 Share Posted June 14, 2013 Hi Sanda, please help me, I do not understand your solution. What this solution works well in ... Thanks 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