This example illustrates how to generate a document according to the end-user input. To pass specific values to the document's detail section, you just need to assign these values to the e.Data parameter of the SimpleLink.CreateDetail Event. As for the report (page) header (footer) sections, it is necessary to override their DataContext, which is accessible via the corresponding Link properties. For instance, use the LinkBase.PageHeaderDataContext Property to set the data context of a PageHeader.
NOTE: We have a suggestion to enable printing in marginal sections of a document: Links - Provide the capability to define a print template for the TopMargin and BottomMargin areas of a page