问题描述:
DevExpress.XtraReports.v11.2这个版本中,PrintingSystem属性是只读的,没有办法给它赋值了,DevExpress.XtraReports.v7.2版本里面这个属性是可以赋值的,请问这个应该怎样解决呢?
问题解答:
最新版的XtraReport控件的PrintingSystem属性是只读的,这个并不是控件的Bug。目前要实现类似的功能,可使用以下代码实现:
PrintingSystem CreateReport(GridControl gridControl)
{
PrintingSystem ps = new PrintingSystem();
PrintableComponentLink link = new PrintableComponentLink(ps); //{ Component = gridControl };
link.Component = gridControl;
link.CreateDocument();
return link.PrintingSystem;
}
private void button1_Click(object sender, EventArgs e)
{
PrintingSystem ps = CreateReport(gridControl1);
ps.PrintDlg();
}
{
PrintingSystem ps = new PrintingSystem();
PrintableComponentLink link = new PrintableComponentLink(ps); //{ Component = gridControl };
link.Component = gridControl;
link.CreateDocument();
return link.PrintingSystem;
}
private void button1_Click(object sender, EventArgs e)
{
PrintingSystem ps = CreateReport(gridControl1);
ps.PrintDlg();
}
技术:.NET
产品:XtraReports(包含在DevExpress Universal套包中)
本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/281.html
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/281.html