问题
I have a report in Visual Studio Report Designer that prints a contract. I want it to have certain terms and conditions on the back of every page. How can I print something on every second page (which I'll then duplex)? I've tried putting it in the page header\footer (it just gets cut off), and I've tried controlling the visibility of it in the body of the report using page numbers (but you can't use the global page numbers variable in the body of the report). How can I wrangle the report to do what I want?
回答1:
Alas, as you already mention: you can't access the page number in the body of a report. I don't think your requirement can be satisfied, there's no real workaround that I know of. The only alternatives (which you may have already considered) I can see so far, ordered from bad to progressively worse:
- Print the note entirely in the header or footer
- Print it on every page
- Post-process the rendered report (PDF?) and add it afterwards
- Do the report twice. Once with the notice on each page, once without. Do your own "duplexing": print the odd pages from the document without, put the paper back in the printer, and print the even pages.
(Like I said, the workarounds were progressively worse from top to bottom :D)
In the extreme case where you know exactly what content ends up on what page number you could link a visibility expression to that content.
来源:https://stackoverflow.com/questions/11322001/visual-studio-report-designer-how-do-i-print-something-on-every-second-page-of