Section Spacings and Header/Footer

91 views
Skip to first unread message

Matt Bergen

unread,
Nov 14, 2013, 4:36:05 PM11/14/13
to dot-net-...@googlegroups.com
Hi,

I'm trying to figure out how to implement proper page margins for a given section.  I thought setting the sections spacing would effectively give me what I want, however, the problem I am having is that when adding the header or footer to the section, they don't appear to be taking the sections spacing into account.  The content inside the header or footer is at the edge of the document instead of starting where the spacing ends.  I would have thought when adding content to the header/footer the coordinates (0,0) would start where the spacing of the section ends, I'm I wrong about that.  I also have added a grid to the section and it appears to be using the sections spacing appropriately.  Below is mostly what I am using, is there something I'm missing to get the headers and footers to drawn between the sections spacings?

Siberix.Report.Section.ISection section = this.SiberixReport.AddSection();
section.Size = Siberix.Report.PageSize.Letter;
section.Spacings.All = 35f;
section.Orientation = Siberix.Report.Orientation.Portrait;

Siberix.Report.Section.IFooter footer = section.AddFooter();     -- this footer is drawn at the edge of the document instead of between the sections spacing.
footer.Repeat = true;

Siberix.Report.Grid.IGrid grid = section.AddGrid();    -- this grid is drawn in between the sections spacing.

Thanks,
Matt

siberix

unread,
Nov 23, 2013, 10:45:52 PM11/23/13
to dot-net-...@googlegroups.com
Hi Matt,

Sorry, i completely forgot to reply to your question in time. It's been an overwhelming week.

The Header and the Footer are placed outside the Section element intentionally, so one could position them right on the edges of the page. To solve your issue you may use one of the following techniques:

1. You may set the size of the header including the size of the top spacing for the section and then place all the rest of the Header's content with the top offset. Or you can add a Group element to the header and set its top spacings.

2. Instead of using section Headers and Footers, you may simply replace them with the Grid's headers and footers. Simply add a Grid element to the section body and add a header and a footer to it. You'll also need to set grid.StretchOnBreak = true to stretch the content of the grid to the entire page height on breaks (so the header and the footer would be right below / above the section's spacings). If you need to stretch the body of the grid on the last page, please se grid.Height = new Siberix.Report.RelativeHeight(100); The rest of your content should be placed in the body of the grid instead of the section.

Hope this helps to resolve your issues.

Thank You,
Victor
Reply all
Reply to author
Forward
0 new messages