I have written single page reports but I am now working on multiple page reports and have questions.
These reports have headers and footers with different content on the pages. The pages have different content for the headers, but the footers have the same content (file name and page number).
ISection has AddHeader(), AddFooter(), AddPage(), and AddPageBreak(). AddPage() returns a ISectionPaage object.
I am confused about how to add pages with different headers and using continuous page numbering in the footers.
I am looking for recommendations.
You didn't mention the DocumentExporterGallery sample to me. Where is this sample? I can't find it on the Infragistics site.
Did you check out the DocumentExporterGallery sample I mentioned? It uses footers for a couple of the samples.
I compared your code to the code in that sample and the only thing it's doing differently than your code is that it's setting the Height of the Footer. So I added setting the height to your code and it works:
mainSectionFooter.Height = 50;
think the header overlapping the text is the same issue. If I explicitly set the height of the header, it works:
mainSectionHeader.Height = 50;
I am getting very frustrated trying to generate a multiple page report with headers and footers. I can get headers to appear, but not footers. Page numbers appear at the bottom of the page as expected. When I add text to a page it overwrites the header. Is there any example code for a multi page report?
Some of the code I am using:
report = new Report()
mainSection = report.AddSection()
mainSectionHeader = mainSection.AddHeader()
mainSectionFooter = mainSection.AddFooter()
hdrTxt = mainSectionHeader.AddText(0,0)
hdrTxt.AddContent("any text", fontstyle)
mainSectionFooter.Repeat = true;
ftrTxt = mainSectionFooter.AddText(0,0)
ftrTxt.AddContent("any text", fontstyle)
page = mainSection.AddPage()
pageHeader = mainSection.AddHeader()
I don't understand why the footer will not appear and why when I add content to a page it overwrites the header.
What I would do is add a grid into your header and then put two columns into the grid. Then you can populate the cells of the grid with the text you want.
var header = section.AddHeader(); var grid = header.AddGrid(0, 0); grid.Width = AutoWidth.Instance; grid.Height = AutoHeight.Instance; var col0 = grid.AddColumn(); var col1 = grid.AddColumn(); var row0 = grid.AddRow(); var cell0 = row0.AddCell(); var cellText = cell0.AddText(); cellText.AddContent("This is the left side of the header"); var cell1 = row0.AddCell(); cellText = cell1.AddText(); cellText.AddContent("This is the Right side of the header");
Thank you for the reply. I was able to generate different headers for the first page and subsequent pages. Use section.AddHeader() and then section.AddPage().
The project I am working on is to convert existing code from using Component One controls to Infragistics WPF & Reporting.
Now I am trying to figure out how to have two equal width columns in the header. I know I can use band.AddFlow() and Flow.AddColumn(), but how do I set the column width to half of the page?