I have tried to export the contents of a grid containing hierarchical data into a pdf file using the DocumentExporter. The result looks very nice and is formatted so that it fits the page of the pdf document. However, all the rows of the data within the grid are displayed (including those which need to be drilled down to be seen) even if they are not visible in the grid. I used the PrintDocment control to print the contents of the grid and here the output matched the grid display and only showed data that was visible in the grid but the columns require reformatting to ensure they fit on the page.
Is it possible to combine the benefits of both these methods so that I can get an output that is nicely formatted and only displays the rows that are visible (i,.e drillled down) in the grid?
Many thanks for any help received
Formatting it how? I don't understand the question. Printing has an optional parameter which determines which properties are copied from the real grid row to the print row. Also, events like InitializeRow will fire when you print and you can check the IsPrintLayout property on the layout to determine if the row it a print row or a regular row.
Perfect!
Just what I was looking for with the pdf export.
Is there an easy way of formatting the direct print method as well?
Try this:
private void ultraGridDocumentExporter1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.DocumentExport.DocumentExportInitializeRowEventArgs e) { if (e.Row.Expanded == false) e.SkipDescendants = true; }