DevExpress.XtraGrid.GridControl 控件自带打印功能如何实现
2个回答
展开全部
GridControl自带Print方法,如果默认打印不能满足需要可以使用PrintingSystem的对象实例来定制,例如:
PrintingSystem printingSystem1 = new PrintingSystem();
PrintableComponentLink printableComponentLink1 = new PrintableComponentLink();
// Add the link to the printing system's collection of links.
printingSystem1.Links.AddRange(new object[] {printableComponentLink1});
// Assign a control to be printed by this link.
printableComponentLink1.Component = gridControl1;
// Set the paper orientation to Landscape.
printableComponentLink1.Landscape = true;
//显示打印预览
printableComponentLink1.ShowPreview();
//直接打印
printableComponentLink1.PrintDlg();
PrintingSystem printingSystem1 = new PrintingSystem();
PrintableComponentLink printableComponentLink1 = new PrintableComponentLink();
// Add the link to the printing system's collection of links.
printingSystem1.Links.AddRange(new object[] {printableComponentLink1});
// Assign a control to be printed by this link.
printableComponentLink1.Component = gridControl1;
// Set the paper orientation to Landscape.
printableComponentLink1.Landscape = true;
//显示打印预览
printableComponentLink1.ShowPreview();
//直接打印
printableComponentLink1.PrintDlg();
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询