Hi guys,
I'm desperately trying to find the easiest way of accomplishing this. In short I have a RadGridView of which I have used the ExportToPdf method successfully to export the grid in a landscape format to PDF.
GridDetails.ExportToPdf(stream,
new
GridViewPdfExportOptions()
{
ShowColumnHeaders =
true
,
ShowColumnFooters =
true
,
ShowGroupFooters =
true
,
PageOrientation = PageOrientation.Landscape,
ExportDefaultStyles =
true
,
AutoFitColumnsWidth =
true
});
I have been asked whether I can now include the company logo and title to the top, as well as additional text at the bottom. I have looked at trying to use the ExportToRadFixedDocument method, however I cannot seem to get the grid to appear in landscape.
I have tried the following code only to find the page rotated to be landscape, but it's contents appearing as if it were still portrait:
GridViewDocumentExportOptions options =
new
GridViewDocumentExportOptions();
options.AutoFitColumnsWidth =
true
;
options.ExportDefaultStyles =
true
;
options.ShowColumnHeaders =
true
;
RadFixedDocument fixedDoc = GridDetails.ExportToRadFixedDocument(options);
RadFixedPage page = fixedDoc.Pages[0];
page.Rotation = Telerik.Windows.Documents.Fixed.Model.Data.Rotation.Rotate270;
This makes sense as the Fixed document is no doubt generated in portrait by the ExportToRadFixedDocument method and unlike GridViewPdfExportOptions, GridViewDocumentExportOptions does not have a PageOrientation property to specify otherwise.
My last remaining option was to use RadFixedDocumentEditor and draw the whole thing from scratch, however if I can avoid this I would rather not spend the time trying to figure out where to draw each row of the grid and whether it needs to be split across multiple pages.
Am I missing something? Is there an easy way to generate a FixedDocument from a RadGridView that has it correctly rotated from which I can then add additional items using the FixedContentEditor.
Thanks
Marc