Report Explorer is a component that displays the structure of the current report opened in the designer as a tree. It also allows you to change the report, add or remove entities from it, affects the selection.
The code example below demonstrates how to attach Report Explorer to the Designer programmatically, using the ReportExplorerInternal.ReportDesigner property in GrapeCity.ActiveReports.Design.ReportExplorer namespace.
C#. Paste the code in Form.cs |
Copy Code
|
---|---|
using GrapeCity.ActiveReports.Design; using GrapeCity.ActiveReports.Design.ReportExplorer; class MyForm : Form { MyForm() { var _designer = new Designer() { Dock = DockStyle.Fill }; var reportExplorer = new ReportExplorer { Dock = DockStyle.Left, //now the reportExplorer instance will reflect the state of the report opened //in the designer control represented by '_designer' variable. ReportDesigner = _designer }; Controls.Add(_designer); Controls.Add(reportExplorer); } } |
All nodes in the Report Explorer are visible by default. However there are specific nodes that you can hide from the Report Explorer. These specific nodes are:
The code example below demonstrates how to make the Report Explorer display the two nodes: Data Sources (including DataSet node) and Parameters.
C# |
Copy Code
|
---|---|
reportExplorer.VisibleNodes = ReportExplorerNodes.DataSourceAndFields | ReportExplorerNodes.Parameters; |
All report changes are reflected in the Report Explorer, which may look unattractive in case of multiple operations.
With the ReportExplorerInternal.ContentsVisible property in GrapeCity.ActiveReports.Design.ReportExplorer namespace, you can hide the Report Explorer content for some time and then show it again as demonstrated in the code example below.
C# |
Copy Code
|
---|---|
reportExplorer.ContentsVisible = false; BulkUpdate();//performs some bulk update operation reportExplorer.ContentsVisible = true; |
You can set enabled nodes to control actions to be performed to a report. For example, you can deprecate modifying the Parameters list from the ReportExplorer using the ReportExplorerInternal.EnabledNodes property in GrapeCity.ActiveReports.Design.ReportExplorer namespace. In this case, existing report parameters will be visible in the Report Explorer but a user will not be able to edit them.
C# |
Copy Code
|
---|---|
reportExplorer.EnabledNodes = ReportExplorerEnabledNodes.All ^ ReportExplorerEnabledNodes.Parameters; |