lknueve Posted April 20, 2011 Share Posted April 20, 2011 Hello. I have a Page Header where I only want a couple of text fields to display on the first page. The problem is that they are large text fields, and when going to page 2, the column header band doesn't start until about half way down the page due to these fields in the page header band. I have in the properties of the text fields the "Print When Expression" set to "$V{PAGE_NUMBER} == 1" which is working, but is there any way to set the page header to shrink when these fields are not displayed? Any help would be great thanks! Link to comment Share on other sites More sharing options...
jpauze Posted April 20, 2011 Share Posted April 20, 2011 Instead of putting print when expression on the test fields themselves put it on the page header band itself, this will eliminate the band completely except for the first page. Probably the easiest way. I can think of another if that doesn't work for you, let me know Link to comment Share on other sites More sharing options...
lknueve Posted April 21, 2011 Author Share Posted April 21, 2011 Thanks for the quick reply! Unfortunately, can't do that. I have other fields in the Page header that do need to display on each page. What's your other idea? Link to comment Share on other sites More sharing options...
lknueve Posted April 21, 2011 Author Share Posted April 21, 2011 oh - one other thing I've tried is putting a page break in, but then I get an infinite loop error message... Link to comment Share on other sites More sharing options...
jpauze Posted April 21, 2011 Share Posted April 21, 2011 Let's get creative shall we..... I think I have another alternative as well which I will try but this might work for you.Add another detail band and make sure it's the first detail band. Put this fields you want to show on the first page only in this detail band and set the print when expression to "$V{REPORT_COUNT} == 1"What this will do is only print that detail band for the first record and therefore should print directly after the page header on the first page only. Didn't say it would be pretty. Link to comment Share on other sites More sharing options...
jpauze Posted April 21, 2011 Share Posted April 21, 2011 Another alternative might be to put a subreport in the page header and set the size really small, say like 1x1 pixel or 0x0 for that matter, then put the print expression on the subreport that way it will only be printed on the page headers you want to include it on. Link to comment Share on other sites More sharing options...
lknueve Posted April 21, 2011 Author Share Posted April 21, 2011 well, I've tried both options you've listed -> the additional detail band throws my column header band in the wrong location, and the subreport is giving me a blank first page? Do you by any chance have other ideas? Thanks so much!!! Link to comment Share on other sites More sharing options...
jpauze Posted April 22, 2011 Share Posted April 22, 2011 Didn't realize you were using columns/colum-headers, options still valid and to be sure I create a sample, have a look at the pdf (attached) I think this is what you are trying to do?Adding a subreport to the page header section.Definitely works for me, I have attached two screen shots to show you what I did, i added a subreport in the page header of the main report and set the size 1x1 just below the text that will appear on each header page. I set the print expression to only run the report on the first page, I pass in an empty datasource, see report1.jpg (attached) On the sub report I just added a title band with the info I want to print, no detail bands will print as the report data source is empty, see report 2.jpg (attached)BTW, I also validated that the other other option using a detail band as a "fake" second page header band works with columns in detail bands but requires a slightly different approach. If the above still doesn't work for you, let me know and I will send further instructions. Link to comment Share on other sites More sharing options...
lknueve Posted April 22, 2011 Author Share Posted April 22, 2011 Thank you for all your answers/work! I really do appreciate it! Link to comment Share on other sites More sharing options...
lknueve Posted April 22, 2011 Author Share Posted April 22, 2011 I was missing the page number variable which is why the page break wasn't working? once I put the page number in the report, it started working properly - weird! Link to comment Share on other sites More sharing options...
falbala Posted August 31, 2012 Share Posted August 31, 2012 I know this is an old issue but I have exactly the same problem. I tried your solution but it didn't work in my case, I think it's due to iReport 3, which is the iReport version I'm using in my project. Is it possible? In my case, the subreport is never printed, even though I don't set a conditional expression. Any idea?Thanks in advance. Link to comment Share on other sites More sharing options...
C-Box Posted September 7, 2012 Share Posted September 7, 2012 Hi guys,if there are different page-header sizes needed and you don't want to use SubReports you coud think about a simple "dummy" group with option "ReprintHeaderAtEachPage" set to true.So the GroupheaderBand will be printed at every page.With an addional groupheader (right click in ireport... add another group header band) you coud easily manage two different sized header bands... the first with PrintWhenExpression : $V{PAGE_NUMBER}.intValue() == 1 and the other with $V{PAGE_NUMBER}.intValue() > 1So you needn't use the static page-header band and have two different sized header bands for each page. btw. the group-expression could be empty or just nulljust my two centshthC-Box 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