protected virtual object CreateLink(DevExpress.XtraPrinting.IPrintable printable) { if (_PrintParam != null) { _PrintableLink.PrintingSystem.PageSettings.Landscape = _PrintParam.Landscape; } if (_PrintableLink == null) { return(null); } _PrintableLink.Component = printable; _PrintableLink.CreateDocument(); return(_PrintableLink); }
public void ShowDevPreview(DevExpress.XtraPrinting.IPrintable printComponent) { PageHeaderFooterSettings(); PrintingSystem ps = new PrintingSystem(); PrintableComponentLink pc = new PrintableComponentLink(); pc.Component = printComponent; pc.Landscape = true; //是否指定页边距尺寸 if (devMargins != null) { pc.Margins = devMargins; } //是否定义纸张 if (devPaperKind != System.Drawing.Printing.PaperKind.A4) { pc.PaperKind = devPaperKind; } //标题和页脚的显示 pc.PageHeaderFooter = new PageHeaderFooter(PHA, PFA); pc.CreateDocument(ps); pc.EnablePageDialog = enableEditPage; pc.ShowPreview(); }
/// <summary> /// 显示预览窗口。 /// </summary> /// <param name="printable"></param> public void ShowPreview(DevExpress.XtraPrinting.IPrintable printable, XPrintParam printParam) { _PrintParam = printParam; CreateLink(printable); _PrintableLink.ShowPreview(); }