Report Generator FastReport.NET

On the market for the Net.platform, a new player has come up – FastReport.Net, from the company called Fast Reports. The company has been developing report generators for many years already. Its product Fast Reports VCL is one of the most known report generators for Delphi/C++ Builder. And now – solution for .Net.
Report generator – this is a special program class and programs components, which solves the task of setting information in the comfortable form as needed by the user. Whenever there is a need for creating reports, immediately the need for a good report generator comes up. As a result, many report generators have been developed – on different platform, many developers, programming languages e.t.c.

The tendency is, that at the moment many more developers transfer their products to the Microsoft .NET Framework. Accordingly, there is need for a report generator written on that same platform. As only those specially written by using the .Net components can effectively use all the advantages, being offered by this platform.

FastReport.Net was written in C#, on a 100% code control. It was meant to create reports using the Windows Forms and ASP.NET in Microsoft Visual Studio and oriented on the second version and above versions of .Net.

The new report generator is like Fast Reports VCL. The same report structure, the same bands, similar control elements and expression syntax. Multipage reports, designer in the style of MS Office, direct connection to the data base, the possibility of creating autonomous reports independent from the application, report inheritance, interactive reports, script language support and many more..

There is also a list of interesting differences, in the first place, depending on the platform. In FastReport.Net , there is a non-relational data source support included, realizing the IEnumerable interface. As a script language, C# and VB.NET are used. There is a possibility to save created reports in form of C#/VB.NET classes, added new, very compact band preview mode and many more.

Let us look at the capabilities of the generator in details.

Report designer
The key component of FastReport.Net is the report designer. The designer has got a classic view – the report workspace, data tree, report component tree, the panel with selected components properties e.t.c. By structure, it reminds of the Fast Reports VCL designer, only its appearance and the behavior of components correspond with Microsoft Visual Studio standard and not Delphi

FastReport.Net – band –oriented report generator. Band- this is a control element, which is placed on the report page and is the container for the rest of the control components. In FastReport.Net, there are 30 types of bands. 2 for report, page, column and group (header, basement). 3 for data – “data” band, data basement and data header. And there are also 2 extra bands – child and background.

Report band structure is set by using the “Report” menu. The menu allows, just by one click of the mouse, to enable or disable those bands which can be met only once in the report. The rest of the operations on editing the structure are done in the “Band settings” window. Here, it is possible to add a child band, groups, “Data” band nesting, band order and many more.

The designer supports two modes of band display- classic (like in Fast Reports VCL) and compact. In classic mode, the band is drawn with a header. In compact mode, the band header is not there – the name of the band is displayed on the left side of the work space. Compact mode is more comfortable to work with – the structure of the report is clearly seen, the report itself is more visible. But it has one shortage – the report becomes wider. So, for comfortable working, a bigger monitor is needed.

FastReport.Net allows placing on the bands objects of the following types: “Text”, “Formatted text”, “Picture”, “Line”, “Bar code”, “Flag”, “Table”, “Matrix”, “Nested reports”, “Diagram”, and also the creation of control elements on your own.

Binding object to data is done with the help of expressions. A typical example of an expression is “[Data source name. Field name]”. Writing a similar text manually is not needed – clicking the mouse once is enough.

The capabilities of expressions are not limited by the data source access function. Expression – this is a line of code in script language. With the help of an expression, you can access the system variables, report variables, receive the total value, call .Net function and many more.

Diagram support in FastReport.Net is done with the help of the free Microsoft Chart library. This library can be used starting with the Net 3.5SP1. It will be in the contents of .Net 4.0, but of now, you need to install it separately.

Report types
FastReport.Net allows creating all the main types of reports: master-detail, master-master, cross tables and many more.

A report can be multicolumn, and also, multicolumn can be done as pages and as separate bands.

A report can be multipaged. This possibility is ideal for creating all sorts of booklets, whose title and last pages have got a special formation, and even and odd pages differ in fields and headlines.

FastReport.Net allows creating nested reports. Nested reports are placed on the band as ordinary object. During this, for every nested report a separate page is created. Nested reports can be very useful. For example, by placing 2 “Nested reports” objects near, you can print two independent data list, placed near each side-by-side.

A nested report can contain another nested report. Hierarchy of nesting can be very complex. However, too complexed hierarchy complicates the report; it will be hard to understand it. The same applies to master-detail reports. In FastReport.Net, you can create master-detail-detail reports and add unlimited number of slave bands.

A new report in FastReport.Net is created with the help of the master. Standard report master allows giving the data source for the report, choosing the field to show, giving grouping criteria, show report style. Several clicking of the mouse – and the “Fish” report is ready

An interesting capability of FastReport.Net is its ability to group data. An ordinary master-detail
Report needs two connected data sources. With the help groups, you can create similar reports, by using only one data source.

Reports in FastReport.Net can be done interactively, that is. Reacting to the clicking of the mouse. Supports two types of interaction with the user:

  • When clicking on the band, object can be doing something, for example, showing a detailed report in a separate window.
  • Preview window can show the structure of the window, with the help of which its possible to navigate on the report.

In the report a dialogue window can be used. Dialogue – this is a window with control elements, which shows up in when running the report. The dialogue can be used for entering, more variables in the report or for choosing data filtration variables.

Built report can be seen on the screen, printed on the printer or exported to one of the supported formats. All this is done in the preview window. Export to the following formats is supported RTF, HTML, PDF, Excel, Open Office Calc. You can save the report in one of the following “native” formats FPX (XML, compressed with the help of ZIP).

Data source
Data for forming reports comes into FastReport.Net from the data source. The source is given by either of the following methods: need to either register the data source in the report from your application or create a source right in the report..

Registration of the source is done by programming means. If in form of source, we place the Dataset , component on the form. For creating a data source programmatically, there is need to call the RegisterData function manually.

If you create the report, which will work independent from the application, then the data source needs to be given right in the report. FastReport.Net is able to connect directly to many modern СУБД, including MS SQL, Oracle, VistaDB, Postgres, Access, and even data from XML-file (you can include other types of connections). As source parameters, a name is given or SQL-query.

FastReport.Net supports two types of data source relational and hierarchical. With relational, all is clear – this is a ADO.NET table. Hierarchical – this is a collection of objects, which supports the IEnumerable Interface. An object in the same collection can contain many complex structures.They can contain other complex objects. As a result, such a source can be a complex hierarchical object.

Hierarchical source gives good possibility to enter data into the report, which is saved in the application in the form of a list of objects and not relational tables. Unfortunately, working with it is not very comfortable. Hierarchical source in the report can be registered only programmatically, as a result when developing reports in Visual Studio, these sources are not seen. The problem can be avoided by, editing the report from the working application, which has already been registered.

Script
As a script language, FastReport.Net uses either C# or VB.Net.

In the report designer, on the “Code” tab, an important report script class is shown. Here the report object events are given. You can create your own classes, variables, methods, and properties.

In the script code, you can refer to the report object by name. The above syntax is for referring to any object: control elements, data source, report variables e.t.c. In the script, it’s allowed to use any assembly. You just need to connect it to the report properties.

Script allows non standard data handling, control of report page and band printing, formatting dynamic tables and many more. The process of band printing is detailed in documentation. With the help of script, using different object events, it’s possible to control practically every report editing moment.

Script editor supports a lot of functions: IntelliSense, syntax illumination, floating prompt for code elements, dynamic checking of the correctness of code. What is missing – it’s the data code debugging means. The special “Compilation” command has not been looked at, or checking the correctness of code. Truly, for this function, you can use the preview command.

When running the report, Fast Report automatically adds a list of variables, whose names correspond with the names of the elements, into the script. In the script, all expressions used in the report, are added are added in form of functions. After this, the script is compiled and the report runs.

Integration with Visual Studio
FastReport.Net adds on the panel Visual Studio panel 3 new components:

  • Report – report component;
  • PreviewControl – visual component, implements the possibilities of previewing the report;
  • EnvironmentSettings –with its help, you can give a series of global report settings, implementing in the report an open/save dialogue file, sending to the report a row connector and others.

By default, the created reports can be saved automatically in the application resources. Another variant of saving reports –in form of separate FPX-files. Third – save reports in form of C# or VB.NET classes and include them in the applications code.

Assembly size
Together with the application, in FastReport.Net, you need to have the following:

  • FastReport.dll (2 mb) – main FastReport.Net library;
  • FastReport.Dock.dll (0,3 mb) – library for organizing floaters windows;
  • FastReport.Editor.dll (1,5 mb) – code editor with illuminating syntax.This library is not needed if your application is not using report designer;
  • FastReport.MSChart.dll (3,8 mb) – this is a set of the requirements , only if you are using diagrams in the report..

On the above mentioned measures, a report has got a compact size.

System requirements
Microsoft .Net Framework 2.0 or above.
Visual Studio 2005/2008.
Windows Forms/ASP.NET.
Current generator version 1.0.186.

Bussiness rivals
Report Sharp-Shooter
Stimulsoft Reports.Net

Conclusion
FastReport.Net – This is a very interesting report generator .Developers did not fail –the generator has got a great set of functions, comfortable, compact and fast at work. There isn’t any information in connection with the product yet. There is a trial application together with the demo version,which allows to judge the see all the capabilities of FastReport.Net. You can have access to all the documentation, SDK and forum.

Due to a shortage, I would have noted the lack of script debugging. But this, is likely, the general problem with all report generators for .Net – the code is saved in the report in form of input text and compiles directly when creating reports. And also – the generator supports only Microsoft Visual Studio, support to Delphi/C++ Builder is not ready yet.

first source: www.softkey.info
translated specifically for:www.reportingfor.info

Comments are closed.