2

我有一个 devexpress 报告,我想在运行时运行报告设计器,可以吗?如果可能请告诉我路

4

3 回答 3

4

这很容易做到,我已经写了下面的代码,这将有助于做你想做的事

using System;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;
// ... 

private void Form1_Load(object sender, EventArgs e) {
    XtraReport1 report = new XtraReport1();
    ReportDesignTool dt = new ReportDesignTool(report);

    // Invoke the standard End-User Designer form. 
    dt.ShowDesigner();

    // Invoke the standard End-User Designer form modally. 
    dt.ShowDesignerDialog();

    // Invoke the Ribbon End-User Designer form. 
    dt.ShowRibbonDesigner();

    // Invoke the Ribbon End-User Designer form modally. 
    dt.ShowRibbonDesignerDialog();
}
于 2013-06-22T08:55:08.777 回答
1

请注意,在最近的版本中(例如 14.1),您需要添加对DevExpress.XtraReports.vxx.x.Extensions.dll的引用

using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.UserDesigner;    
// ...

private void btnDesign_Click(object sender, EventArgs e)
{
    var rpt = new Reports.XtraReport1();
    var designer = new ReportDesignTool(rpt);
    designer.ShowRibbonDesignerDialog();
}
于 2014-11-12T18:17:27.670 回答
-1
using System;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;

private void Form1_Load(object sender, EventArgs e) {
    XtraReport1 objreport= new XtraReport1();
    ReportDesignTool objReportdesigner = new ReportDesignTool(objreport);

    // Invoke the standard End-User Designer form. 
    objReportdesigner.ShowDesigner();

    // Invoke the standard End-User Designer form modally. 
    objReportdesigner.ShowDesignerDialog();

    // Invoke the Ribbon End-User Designer form. 
    objReportdesigner.ShowRibbonDesigner();

    // Invoke the Ribbon End-User Designer form modally. 
    objReportdesigner.ShowRibbonDesignerDialog();
}
于 2015-06-03T11:25:14.480 回答