I searched around, but could not find a specific answer to this one.
I have a pretty basic report with a cover page that should have no headers or footers, and the rest of the report which should have the same header and footer on each page.
I can't figure out how to use cfdocument so that the header and footer do not appear on the first page. I tried using this code which didn't work:
<cfdocumentitem type="header" >
<cfif cfdocument.currentpagenumber GT 1>
<div style="border-bottom:1px solid #673951;padding-bottom:20px;float:left;width:100%"><img src="../images/logo_print_150.jpg" width="180" height="52" /></div>
Is there a way around this?
I know im several months late in responding to this but here goes...(Sorry not a lot of help here..but some validation)
This seems to work fine for me when doing a footer but there are issues with running a conditional in the header ... for some odd reason. What you are doing is what I am using in the footer and no issues. I copy that to the header...should work right? Nope.
Adobe still has some work to do on making PDF's working properly with ColdFusion. Seeing as they also author Acrobat you would think this woudl be a no brainer...guess not.
Are you using the evalAtPrint attribute? See documentation for more info.
I realize this is well over a year after the original post, but I just came across it look for an answer to a question I had, maybe it will help someone someday.
There's a simple way to do this. Headers and footers not used inside a cfdocumentsection apply to the whole document. But used inside cfdocumentsection tags only apply to that section. So it can be done as follows:
cover page goes here
header goes here
main body goes here
The trick to this, is that if you don't explicitly know where the page break will occur, you can't reliably wrap "just" the first (or second or third...) page with a section tag such that you can then control the header.