如何在Visual Studio 2010上将XtraReport连接到Windows窗体

时间:2011-02-24 10:00:08

标签: c# visual-studio-2010 devexpress

如何在Visual Studio 2010上将XtraReport连接到Windows窗体(这也必须使用XtraGrid进行报表查看)

1 个答案:

答案 0 :(得分:1)

  1. 创建表单
  2. 添加PrintBarManager
  3. 创建新的XtraReport
  4. 并尝试在表单中使用此代码

        public partial class YourForm : XtraForm
        {
            private YourXtraReport report;
            public YourForm(PrintDocument document )
            {
                InitializeComponent();
                report = new PrintingDocumentReport(document);
            }
    
    
            private void PrintingFormLoad(object sender, EventArgs e)
            {
                printControl1.PrintingSystem = report.PrintingSystem;
                report.CreateDocument();
            }
        }