DEV XtraReport PrintControl PrintBarManager 模板显示

XtraReport report = null;
PrintControl printControl = null;
PrintBarManager printBarManager = null;

 string reportFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ReportFiles", "scRouteView.repx");//模板路径

public FormQueryDynamicData()
{

report = new XtraReport();
report.LoadLayout(fs);//加载模板
printControl = new DevExpress.XtraPrinting.Control.PrintControl();
printBarManager = new PrintBarManager();
printBarManager.Form = printControl;
printBarManager.Initialize(printControl);
printBarManager.MainMenu.Visible = false;
printBarManager.AllowCustomization = false;

report.RequestParameters = false;
report.DataSource = Utils.ToDataTable(new List<ViewRouteMdl>());

report.ShowPreviewMarginLines = false;
report.CreateDocument();//创建模板文档

printControl.PrintingSystem = report.PrintingSystem;
printControl.Dock = DockStyle.Fill;
printControl.Refresh();
printControl.ShowPageMargins = false;
panel1.Controls.Add(printControl);

 

posted @ 2018-11-29 21:46  吃葡萄不吐葡萄脾  阅读(342)  评论(0编辑  收藏  举报