用于WinForms的DevExpress报告控件允许您自定义纸张格式、方向,并将自定义信息添加到报告中。请注意,以下方法适用于实现可打印接口的控件(例如,XtraGrid、XtraPivotGrid、Xtra Scheduler、XtraTreeList、XtraCharts、Layout Control、XtraVerticalGrid等)。
启动VS2019并创建一个新的Windows窗体应用程序或打开一个现有的应用程序。然后,运行“工具箱”并将实现IPrintable接口的所需控件拖放到窗体上。

Customize Print Options at Runtime
运行时自定义打印选项
IPrintable界面允许您自定义打印设置,并使用PrintableComponentLink打印控件。以下代码演示如何创建PrintableComponentLink,并将控件分配给其PrintableComponentLinkBase。组件属性,调整其打印设置,然后打印控件。
using DevExpress.LookAndFeel;
using DevExpress.XtraEditors;
using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.Links;
using DevExpress.XtraPrintingLinks;
//...
public partial class Form1 : XtraForm {
//...
private void gridControl1_Load(object sender, EventArgs e) {

最低0.47元/天 解锁文章
5787

被折叠的 条评论
为什么被折叠?



