MindFusion.Reporting for WinForms report designer programming interface overview

MindFusion.Reporting for WinForms is a native Windows Forms programming component that provides professional reporting functions for any .NET application. The component is completely written in C# language, which is easy to use and integrate. It provides everything you need to create a perfect report. MindFusion.Reporting for WinForms has now been added to the online order. The original price of the Standard Single Developer version was 2848. Now you can buy the instant discount for only 2345. View details >>

Click to download the latest trial version of MindFusion.Reporting for WinForms

Programming interface overview

The next few chapters will give you an overview of most of the functions of MindFusion.Reporting, grouped by function. Hyperlinks refer to detailed descriptions of the methods and properties of each class.

Report designer

MindFusion.Reporting provides rich design-time support to facilitate the creation and modification of reports. The MindFusion.Reporting report designer is seamlessly integrated in the MS Visual Studio environment. The designer is very intuitive because it behaves very similar to the built-in Windows Forms editor of MS Visual Studio. Below you can see a sample report opened in MS Visual Studio using MindFusion.Reporting designer.
Insert picture description here

When you open a source code file that contains 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 will be automatically activated. The report designer provides a way to visually edit the report layout. The following chapters will describe the main functions of MindFusion.Reporting in detail.

Create report project

Items in the designer can be created in the same way as in the Windows Forms designer-drag the item from the toolbox and drag it to the surface of the report designer. Alternatively, you can double-click an item 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, and it will become visible when you activate a report designer. You can also drag ordinary Windows controls into the report, which will create a ControlWrapper report item for the control.

Note description
The "Document Outline" window of MS Visual Studio can help you view the report items in the report. To open the "Document Outline" window, select the "View -> Other Windows -> Document Outline" command from the menu.

For more information about the various items that can participate in the report, see Report Items.

Report structure

Each report consists of one or more design pages. These pages provide a way to design logically independent parts of a complex report. For example, you can set one page for the report title and general report information, and another page for the actual content of the report. You can place all report elements on one page and use the PageBreak item to represent page breaks, but for more complex reports, this single page may become quite large and difficult to operate. In this case, dividing the report into several logical pages can improve the design-time experience.

Project contains

Each report page can contain any number of report items. Some report items (such as DataRange) can have their own items, including other containers. This forms a hierarchy of report items, and the root of the hierarchy is the report itself.

In order to place the new project in a specific container, drag the project from the MS Visual Studio toolbox and drop it in the container of interest. You can perform the same technique on existing projects-simply drag them onto the container.

Header and footer

The report page can contain headers and footers. The header and footer contain the items displayed on each page instance in the final report layout. For example, it is common to place a label in the footer that shows the current page number.

By default, the page has no header and footer. To create one, right-click on the page surface in the designer and select the "Header" or "Footer" command from the context menu. Make sure you click on an unoccupied part of the page, otherwise the context menu will only contain "Header" or "Footer". Otherwise the context menu will only contain commands specific to the element being clicked. The following figure shows how the context menu of the report page should look like.

Insert picture description here

Once the header or footer is created, it becomes visible in the designer and is placed above or below the content area of ​​the page. The image below shows a page designer with a header and footer, both outlined in red.

Insert picture description here

You can expand or collapse each part of the page by clicking the and buttons in the section header respectively. Folding a section does not affect how it will appear in the final report layout. It only affects the appearance of the page when it is designed.

Like other elements in the report, you can resize them by selecting part of the page and dragging the resize handle that appears on the selection border. Parts of the page can only be resized to the bottom and right. In addition, you can also adjust the size of part of the page by dragging the header with the mouse.
Header and footer of data range

DataRange objects can have their own headers and footers, similar to page headers and footers. The header and footer of the data range are displayed at the beginning and end of each occurrence of the data range in the final report layout. For example, if a data range is divided into two pages, then its header and footer will be displayed once on both pages. The header and footer of the data range are usually used to display the column header text.

To create a header/footer for a data range, right-click on the surface of the data range in the designer and select the 'header'/' footer' command in the context menu. Unlike page, the header and footer of the data range do not have a header and can be resized in any direction.

Design toolbar

The toolbar is displayed at the top of the report designer. Most commands in the toolbar only affect the behavior of the designer, and rarely affect the way the report is output at runtime.
Insert picture description here

There are the following commands in the designer toolbar:
Insert picture description here

In addition to the default toolbar, the report designer also takes advantage of the built-in layout features in MS Visual Studio. These functions can be accessed through the "Format" menu or the "Layout" toolbar. Right-click on other MS Visual Studio toolbars and select "Layout" from the context menu to display the toolbar.

Designer's toolbox

When the report designer is active, a new set of elements (called MindFusion.Reporting) can be seen in the MS Visual Studio toolbox. It contains all report items available in the report.
Insert picture description here

More detailed information about individual report items can be found in the report items.

Guess you like

Origin blog.csdn.net/RoffeyYang/article/details/113640854