MindFusion.Reporting provides rich design-time support in order to facilitate the creation and modification of reports. The MindFusion.Reporting report designer integrates seamlessly in the MS Visual Studio environment. The designer is very intuitive because its behavior closely resembles the built-in Windows Forms editor of MS Visual Studio. Below you can see a sample report opened in MS Visual Studio using the MindFusion.Reporting designer:
The report designer is automatically activated when you open a source code file containing a MindFusion.Reporting report, that is, when you double-click the file or select the 'View Designer' command from its context menu. The report designer provides means for editing the layout of a report visually. The following sections describe the major features of the MindFusion.Reporting in more details.
Items in the designer can be created in the same way as they are created in a Windows Forms designer - by dragging them from the toolbox and dropping them onto the report designer surface. Alternatively you can double-click on an item in order to create an object of the appropriate type in the currently active report. The report items in the toolbox can be found under the 'MindFusion.Reporting' category, which becomes visible when you activate a report designer. You can also drag common Windows control to the report, which will create a ControlWrapper report item for this control.
Note |
---|
The Document Outline window of MS Visual Studio can help you to see the report items in a report. To open the Document Outline window, choose the 'View -> Other Windows -> Document Outline' command from the menu. |
For more information about the individual items that can participate in a report, see Report Items.
Each report consists of one or more design pages. These pages provide a way to design logically independent parts of complex reports separately. For example, you can have one page for the title of the report and general report information and another for the report's actual contents. You can place all the report elements on a single page and use PageBreak items to denote page breaks but with more complex reports this single page may get rather big and hard to manipulate. Splitting the report into several logical pages can improve the design-time experience in such cases.
Each report page can contain an arbitrary number of report items. Certain report items (such as DataRange) can have items on their own, including other containers. This forms a hierarchy of report items, the root of the hierarchy being the report itself.
In order to place a new item in a specific container, drag the item from the MS Visual Studio toolbox and drop it within the container of interest. You can perform the same technique with existing items - simply drag them over the container.
Report pages can contain headers and footers. The headers and footers contain items that are displayed on each individual instance of the page in the final report layout. For example, a common scenario would be to place a label displaying the current page number in the page footer.
By default, the pages do not have header and footer. In order to create one, right-click on the page surface in the designer and select either the 'Header' or 'Footer' command from the context menu. Make sure you click on an unoccupied section of the page. Otherwise the context menu will contain only the commands specific to the clicked element. The following image displays how the context menu of a report page should look like:
Once the header or footer is created, it becomes visible in the designer and is positioned either above or below the page contents area. The following image illustrates a designer of a page with header and footer, both outlined with a red contour:
You can expand or collapse various page sections by clicking the and buttons in the section's header respectively. Collapsing a section does not affect the way it is rendered in the final report layout. It only affects the design-time appearance of the page.
As with other elements in the report, you can resize page sections by selecting them and dragging the resize handles that appear at the selection border. Page sections can only be resized to the bottom and right. Alternatively you can resize page sections by dragging their headers with the mouse.
DataRange objects can have their own headers and footers, similar to those of the page. The header and footer of a data range are displayed in the beginning and the end of each occurrence of this data range in the final report layout. For example, if a data range is split across two pages, its header and footer will be displayed once on both pages. The header and footer of a data range are usually used to display column header texts.
In order to create a header/footer for a data range, right-click on the data range's surface in the designer and select the 'Header'/'Footer' command from the context menu. Unlike to page, the header and footer of a data range do not have headers and can be resized in any direction.
The toolbar is displayed at the top of the report designer. The majority of the commands in the toolbar affect only the behavior of the designer and rarely have impact on the way the report output at run-time.
The following commands are present in the designer toolbar:
Command | Description | |
---|---|---|
Zoom Out | Reduces the size of the report designer. The minimum zoom factor is 100% thus this option can only be used to reverse the effect of the Zoom In command. | |
| Zoom Factor | Displays the current zoom factor. You can type in any zoom factor in the 100-1600% range. |
Zoom In | Increases the size of the report designer. The maximum zoom factor is 1600%. | |
Previous Page | Moves to the previous page in the report. | |
| Current Page | Displays the current page. You can type in a page number to go directly to that page. |
Next page | Moves to the next page in the report. | |
Add Page | Adds a new page at the end of the report. | |
Delete Page | Deletes the current page. A report should always have at least one page, so, if this is the last page in the report, the deletion will fail. | |
Toggle Grid | Shows or hides the report designer grid. | |
Toggle Grid Snap | Turns grid snapping on and off. | |
Toggle Ordering | Shows or hides the ordering of report items on the current page. |
In addition to the default toolbar, the report designer takes advantage of the layout capabilities built in MS Visual Studio. These features can be accessed either through the 'Format' menu or through the 'Layout' toolbar. The toolbar can be displayed by right-clicking on any other MS Visual Studio toolbar and selecting 'Layout' from the context menu.
While the report designer is active a new group of elements (called 'MindFusion.Reporting') is visible in the MS Visual Studio Toolbox. It contains all report items available to use in a report.
More detailed information about individual report items can be found in Report Items.