I would like to add a custom header and footer to my Excel, XPS, and PDF grid export like I do with Print Preview. Is that possible? As you already know to add the header in Print Preview of the Grid I use
this.ultraGridPrintDocument.Header.TextLeft = this.about.Text;
I cannot find anything similar to that with the other Grid Exports.
Hi Michael
I just wanted to know if you were able to set the Header alignment or you still need help? Just let me know.
Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.
Hello Michael,
You can use Alignment property of the Itext obejct, that is the content of your header:
Infragistics.Documents.Report.Section.ISectionHeader sec = section.AddHeader(); Infragistics.Documents.Report.Text.IText Htext = sec.AddText(5, 5); Htext.AddContent("MY header"); Htext.Alignment = Infragistics.Documents.Report.TextAlignment.Center;
You can find more details about the Alignment property in our online help:http://help.infragistics.com/NetAdvantage/WinForms/2010.1/CLR2.0/?page=Infragistics2.Documents.v10.1~Infragistics.Documents.Report.Alignment.html
Also you have installed locally very useful samples in Windows Forms Feature Browser, there you can find samples about the DocumentExporting Engine under the Publishing and Printing section. There are also various sample with different text style and different objects.
I hope this helps.
That got me headed in the right direction. Thanks. Is it possible on a PDF to center the heading text?
I explained how to do this in Excel here:
UltraGridExcelExporter - Infragistics Community
In PDF, it depends what kind of header you want. There is a header object on the section you could use. You would have to create a report, add a section, then use AddText to add text or some other element into the header and then export the grid into that section.