private void button1_Click(object sender, EventArgs e) { XRDesignFormEx designerForm = new XRDesignFormEx(); designerForm.OpenReport(report); designerForm.DesignPanel.ExecCommand(ReportCommand.ShowPreviewTab); designerForm.ShowDialog(); designerForm.OpenReport((XtraReport)null); designerForm.Dispose(); }
private void button5_Click(object sender, EventArgs e) { XRDesignFormEx designerForm = new XRDesignFormEx(); designerForm.OpenReport(report); StyleSheetEditorForm ssef = new StyleSheetEditorForm(report, null); ssef.ShowDialog(); designerForm.OpenReport((XtraReport)null); designerForm.Dispose(); }
/// <summary> /// 设计报表 /// </summary> /// <param name="path">报表模板的路径</param> public void XtraReport_Designer(XtraReport report, string path) { XRDesignFormEx designForm = new XRDesignFormEx(); designForm.DesignPanel.SetCommandVisibility(new ReportCommand[] { ReportCommand.NewReport, ReportCommand.SaveFileAs, ReportCommand.NewReportWizard, ReportCommand.OpenFile }, DevExpress.XtraReports.UserDesigner.CommandVisibility.None); designForm.OpenReport(report); designForm.FileName = path; designForm.ShowDialog(); designForm.Dispose(); }
// public XRDesignFormEx xrd = new XRDesignFormEx(); public MyReport(XtraReport xr, string filePath, bool flag) { SplashScreenManager.ShowForm(typeof(WaitForm1)); string root = @"C:/jdk/reports"; if (File.Exists(Path.Combine(root, filePath))) { object ds = xr.DataSource; xr = new XtraReport(); xr.LoadLayout(Path.Combine(root, filePath)); xr.DataSource = ds; } SplashScreenManager.CloseForm(); if (flag == false) { xr.ShowPreviewDialog(); return; } XRDesignFormEx xrd = new XRDesignFormEx(); xrd.FormClosing += (s, e) => { if (!Directory.Exists(root)) { Directory.CreateDirectory(root); } xr.SaveLayout(Path.Combine(root, filePath)); }; xrd.ReportStateChanged += (s, e) => { if (e.ReportState == ReportState.Changed) { ((XRDesignFormEx)s).DesignPanel.ReportState = ReportState.Saved; } }; xrd.OpenReport(xr); xrd.ShowDialog(); xrd.Dispose(); }