Hi all,in my UltraGrid I have an ultraGridDocumentExporter to export the Grid content in a PDF file. Is it possible to export in a predefinited pdf template (that has, for example, header and footer).
Thanks a lot.
Luigi
Hi Luigi,
Not sure what you mean by predefined. But you can create a report object and add a header to it or anything you want, then export the grid into it, then write a footer or some more text after the grid.
The sample for the DocumentExporter in the WinGrid samples explorer does this.
You mean this code Mike?
// Header Infragistics.Documents.Report.Grid.IGridHeader header = grid.Header; header.Height = new Infragistics.Documents.Report.FixedHeight(35); header.Repeat = true;
Infragistics.Documents.Report.Grid.IGridCell cell = header.AddCell(); cell.ColSpan = 5; cell.Alignment.Vertical = Infragistics.Documents.Report.Alignment.Middle; cell.Borders = new Infragistics.Documents.Report.Borders(Infragistics.Documents.Graphics.Pens.Black); cell.Background = new Infragistics.Documents.Report.Background(new Infragistics.Documents.Graphics.Color(220, 240, 240));
text = cell.AddText(); text.Style = normalStyle; text.Alignment = Infragistics.Documents.Report.TextAlignment.Center; text.AddContent("Grid Header");
// Footer Infragistics.Documents.Report.Grid.IGridFooter footer = grid.Footer; footer.Height = new Infragistics.Documents.Report.FixedHeight(35); footer.Repeat = true;
cell = footer.AddCell(); cell.ColSpan = 5; cell.Alignment.Vertical = Infragistics.Documents.Report.Alignment.Middle; cell.Borders = new Infragistics.Documents.Report.Borders(Infragistics.Documents.Graphics.Pens.Black); cell.Background = new Infragistics.Documents.Report.Background(new Infragistics.Documents.Graphics.Color(220, 220, 240));
text = cell.AddText(); text.Style = normalStyle; text.Alignment = Infragistics.Documents.Report.TextAlignment.Center; text.AddContent("Grid Footer");