I'm using 2009.1 and it seems that theres a problem saving PDF files to a legal format. You can set the section landscape fine, but the orientation is always legal. In the winform exmaples all pagesizes are set to letter. I attempted to set the targetpapersize to legal in a document exporter but this seems to set the PDF to a much larger size than legal. I'm guessing its adding some padding and margins on top of the section.
Hi,
There is no such property (or any need for such a property) on the UltraGridExcelExporter. TargetPaperSize is used to allow the grid to size the pages of a PDF/XPS document proportionally to the printed size. But Excel printing can span across pages, so there is no need for any kind of proportional resizing of the printed page.
I think maybe you are looking for the PrintOptions on the Worksheet class. This is not exposed directly by the UltraGridExcelExporter. But you could export the grid to a Workbook or Worksheet (as opposed to a File) and set the PrintOptions.
How can I setting TargetPaperSize in the UltraGridExcelExporter ?
UltraGridDocumentExporter has the TargetPaperSize PROPERTY 。 But I Can not find it in the UltraGridExcelExporter.
Maybe I am just not understanding the issue. What do you mean by "the grid it takes up the entire size"?
Are you talking about the vertical or the horizontal? What application are you using to print the PDF file? What options are you using?
I'm not trying to span pages in a PDF, I'm just trying to get a grid to print in landscrape orientation and print on legal size paper taking up the width of the page. Is there a way to set the size of the section or report so when I export the grid it takes up the entire size.
When I use the ultragridprintdocument it prints out fine using
ultraGridPrintDocument1 = new Infragistics.Win.UltraWinGrid.UltraGridPrintDocument(); ultraGridPrintDocument1.Grid = ultraGrid1; ultraGridPrintDocument1.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Legal", 850, 1400); ultraGridPrintDocument1.DefaultPageSettings.Landscape = true; ultraGridPrintDocument1.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 50, 50); ultraGridPrintDocument1.FitWidthToPages = 1; ultraGridPrintDocument1.Print();
You can't span pages horizontally in a PDF document. So the UltraGridExcelExporter uses the TargetPaperSize and Orientation mainly to determine the aspect ratio, not the exact size.
It then sets the width of the pages to the width necessary in order to fit all of the columns in the grid, and the height is set proportionally.
When you print in Adobe Acrobat, the printing options allow you to scale the document to a single page.