public static void Gerar(XtraReport xtraReport, object data, bool edit, List <Parameter> parametros = null) { if (xtraReport != null || xtraReport != new XtraReport()) { report = xtraReport; } dataSource = data; report.DataSource = dataSource; report.RequestParameters = false; if (parametros != null) { foreach (var parametro in parametros) { if (report.Parameters != null) { var parametroAtual = report.Parameters[parametro.Name]; if (parametroAtual == null) { report.Parameters.Add(parametro); } else { parametroAtual.Value = parametro.Value; } } } } if (edit) { using (var xrDesignForm = new XRDesignForm()) { var mdiController = xrDesignForm.DesignMdiController; mdiController.DesignPanelLoaded += (s, e) => mdiController.AddCommandHandler(new CommandHandler((XRDesignPanel)s)); mdiController.OpenReport(report); xrDesignForm.ShowDialog(); if (mdiController.ActiveDesignPanel != null) { mdiController.ActiveDesignPanel.CloseReport(); } } } else { using (var reportPrintTool = new ReportPrintTool(report)) { reportPrintTool.AutoShowParametersPanel = false; reportPrintTool.PreviewForm.WindowState = FormWindowState.Maximized; reportPrintTool.ShowPreviewDialog(); } } xtraReport = report; }
private void button1_Click(object sender, EventArgs e) { XtraReport report = new XtraReport(); XRDesignForm form = new XRDesignForm(); form.DesignMdiController.AddService(typeof(IMenuCreationService), new CustomMenuCreationService(form.DesignMdiController)); form.OpenReport(report); form.ShowDialog(); }
private void ShowReportDesigner() { XRDesignForm form = new XRDesignForm(); XRDesignMdiController mdiController = form.DesignMdiController; mdiController.DesignPanelLoaded += new DesignerLoadedEventHandler(mdiController_DesignPanelLoaded); mdiController.OpenReport(new XtraReport1()); form.ShowDialog(); if (mdiController.ActiveDesignPanel != null) { mdiController.ActiveDesignPanel.CloseReport(); } }
private void button1_Click(object sender, EventArgs e) { // Create a new Design form. XRDesignForm designForm = new XRDesignForm(); // Obtain the Field List and bring it to front. designForm.DesignDockManager[DesignDockPanelType.FieldList].Show(); // Create a new blank report. designForm.OpenReport(new XtraReport1()); // Show the Design form. designForm.ShowDialog(); }
private void Form1_Load(object sender, EventArgs e) { // Create an End-User Designer form. XRDesignForm designForm = new XRDesignForm(); // Handle the DesignPanelLoaded event. designForm.DesignMdiController.DesignPanelLoaded += DesignMdiController_DesignPanelLoaded; // Load a report into the Designer. designForm.OpenReport(new XtraReport1()); // Show the End-User Designer form, modally. designForm.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { // Create an End-User Designer form. XRDesignForm designForm = new XRDesignForm(); // Open a new blank report in it. designForm.OpenReport(new XtraReport1()); // Access the Group and Sort panel. GroupAndSortDockPanel groupSort = (GroupAndSortDockPanel)designForm.DesignDockManager[DesignDockPanelType.GroupAndSort]; groupSort.Visibility = DockVisibility.AutoHide; // Access the Script Errors panel. ErrorListDockPanel errorList = (ErrorListDockPanel)designForm.DesignDockManager[DesignDockPanelType.ErrorList]; errorList.Visibility = DockVisibility.AutoHide; // Access the Field List. FieldListDockPanel fieldList = (FieldListDockPanel)designForm.DesignDockManager[DesignDockPanelType.FieldList]; fieldList.ShowNodeToolTips = false; fieldList.ShowParametersNode = false; // Access the Report Explorer. ReportExplorerDockPanel reportExplorer = (ReportExplorerDockPanel)designForm.DesignDockManager[DesignDockPanelType.ReportExplorer]; reportExplorer.CollapseAll(); // Access the Property Grid. PropertyGridDockPanel propertyGrid = (PropertyGridDockPanel)designForm.DesignDockManager[DesignDockPanelType.PropertyGrid]; propertyGrid.ShowCategories = false; propertyGrid.ShowDescription = false; // Show the End-User Designer form. designForm.ShowDialog(); }
private void buttonDesign_Click(object sender, EventArgs e) { // Open a selected report in the report designer. XRDesignForm form = new XRDesignForm(); string url = GetSelectedUrl(); if (!string.IsNullOrEmpty(url)) { form.OpenReport(url); } form.ShowDialog(this); object selectedItem = listBox1.SelectedItem; FillListBox(); if (selectedItem != null && listBox1.Items.Contains(selectedItem)) { listBox1.SelectedItem = selectedItem; } }
private void LoadDesigner(ReportType type) { XRDesignForm form = new XRDesignForm(); var controller = form.DesignMdiController; if (type == ReportType.Category) { controller.AddService(typeof(ReportTypeService), new CategoryReportService()); } else { controller.AddService(typeof(ReportTypeService), new PersonReportService()); } controller.CreateNewReport(); form.DesignDockManager[DesignDockPanelType.FieldList].Show(); form.ShowDialog(); LoadReportMenu(); }
private void button1_Click(object sender, EventArgs e) { // Create a design form and get its MDI controller. XRDesignForm form = new XRDesignForm(); mdiController = form.DesignMdiController; // Handle the DesignPanelLoaded event of the MDI controller, // to override the SaveCommandHandler for every loaded report. mdiController.DesignPanelLoaded += new DesignerLoadedEventHandler(mdiController_DesignPanelLoaded); // Open an empty report in the form. mdiController.OpenReport(new XtraReport1()); // Show the form. form.ShowDialog(); if (mdiController.ActiveDesignPanel != null) { mdiController.ActiveDesignPanel.CloseReport(); } }