Current filter:
                                You should refresh the page.
                                  • Is it possible to limit how many reporters can be displayed in the report designer
                                    ?

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Peer,

                                Sure. You can override a report command in the same manner as shown in the Override Commands in the End-User Report Designer (Implement Custom Saving) topic to accomplish this task. Note that it is necessary to use the XRDesignMdiController.AddCommandHandler method to add the specified command handler to the command handler list.

                                [C#]
                                private void Form1_Load(object sender, EventArgs e) { reportDesigner1.AddCommandHandler(new NewCommandHandler(reportDesigner1)); } ...   internal class NewCommandHandler : ICommandHandler { private XRDesignMdiController designer; private int limitOpenedReports = 2;   public NewCommandHandler(XRDesignMdiController designer) { this.designer = designer; }   public bool CanHandleCommand(ReportCommand command, ref bool useNextHandler) { useNextHandler = !((command == ReportCommand.NewReport || command == ReportCommand.NewReportWizard || command == ReportCommand.OpenFile) && NumberOfOpenedReports() >= limitOpenedReports); return !useNextHandler; }   private int NumberOfOpenedReports() { List<XtraReport> listOfReports = new List<XtraReport>(); for (int i = 0; i < designer.XtraTabbedMdiManager.View.Documents.Count; i++) { listOfReports.Add(((XRDesignPanelForm)(designer.XtraTabbedMdiManager.View.Documents[0]).Form).Report); } return listOfReports.Count(); }   public void HandleCommand(ReportCommand command, object[] args) { MessageBox.Show("The number of opened reports is limited..."); } }

                                Thanks,
                                Elliot