Dear existing and potential users of the software products Stimulsoft Reports! We continue our series of articles on the optimization of reports. In the previous article of this series we dealt with the theme of creating reports, but as the work with reports does not end with its rendering, so optimization does not end with optimization processes when designing reports.

Today we will share you some tips to help you be able to not only significantly improve the appearance of the final report, but also reduce the amount of resources used, as well as speed up work with reports. Итак, оптимизация экспорта отчетов:

Borders and grid alignment

When exporting reports, our users are often facing with many extra columns in the Excel table. But are they superfluous? After all, each cell corresponds to the border of any component on the page. Otherwise, you cannot display a lot of components scattered across the page. Therefore, when using a table export mode, it is recommended to use the following tips: - Use the button Align to Grid. This will reduce the number of rows and columns in the ready file. The image below shows it very clearly: when exporting, the report on the left will have 25 cells, and the report on the right - only 3. This will help to avoid the very small gaps between components (some formats "do not like", when columns of the table are obtained by a very small size); - Place components in a Data band at the same level. This will reduce the number of rows and columns in the output file as in the previous section.

Borders in reports

Using a Data band instead of Tables

The data can be output from the data source in a report using the Table component or the Data band. The Table is a complex component that is based on the Data band. In the process of rendering a report, the report engine itself decomposes the Table into a Header, Data band, and Footer. When rendering a simple report as a solid table, there is no significant difference between the Table and Data band components, in mdc-files. When rendering a complex report, for example, a table with blank columns, merged with cells in the header and footers etc. The difference might be more noticeable. The Data band component is more flexible in using (although more complex) that allows you to create a more optimized template. For example, for an empty column you may not add a text component, there is no need to merge cells, etc. In the table, an empty cell is not empty and processing and storage requires additional time and resources. Therefore, when you use the Table component, time for the report creation may increase, and the size of the .mdc report file can be larger.

Using graphic primitives

Exporting reports can be faster and easier when you can use graphic primitives instead of the more "heavy" component Shape. Graphic primitives are vertical and horizontal lines, rectangles that are used to create borders of components. A shape is often exported to other formats such as picture, which significantly increases the volume of the exported report.

RichText component

To speed up the export of the rendered report, we recommend you use several ordinary components instead of the RichText component. Since the RichText component is complex, there is the complexity of its processing, for example, because of the use of the system libraries that handle the report quite a long time. Also many formats do not recognize such a text, and it will have to export it as a picture, which can significantly increase the size of the output file. Then there are certain difficulties in the editing of the document.

Rich Text

We should also mention the process of working with reports in the Web - directly in the web browser. This process goes only by means of the browser itself. Some manufacturers use reporting tools Active-X-components to extend the functionality, but these components work only in Internet Explorer. We do not limit our customers which web browser to choose for working with reports. However, we recommend our users do not build very large reports, multi-page reports with a huge amount of data in the web browser. It is caused not only by the fact that the means of the browser considerably limit capabilities for working with reports, but also by the fact that the report rendering goes on web servers, which often have limited resources. For large reports, we recommend splitting them up into smaller reports, and use filters to limit the amount of data displayed. It is unlikely that users will bring pleasure to flip through hundreds of pages in a browser.


Filtering
Dear friends, we continue our series of articles on optimizing reports. Last time we talked about the basics of optimizing directly when creating reports. As for advice for advanced, experienced users of our software products, today we offer a few suggestions to help you avoid unnecessary costs.

As in the previous article, we divided the optimization into two main categories: increasing the speed of rendering reports and reducing memory used for generating reports . So, let’s get started:

Avoid using the Sub-Report component

To speed up report rendering, we recommend you stop using sub-reports in favor of using the DataBand component. The main reason for this recommendation is that, when rendering the Sub-Report, one page of infinite height is created. In the end of rendering this page is broken. This leads to numerous subsequent checks. When using the DataBand component, contents are fully laid out in the main report. In addition, the engine of our reporting tool is highly optimized to work with the DataBand component.

Sub Report

Working with the Report Checker utility

In Stimulsoft Reports, the Report Checker is used for checking the report on errors. This component analyzes the report, resulting in information and error messages or alerts found in reports. If any errors occur while rendering a report, then the Checker generates messages and offers solutions for some of them. For example remove a component, move it to the print area, enable or disable properties, and so on. This will significantly speed up the process of rendering reports.

Checker

Interpretation mode

In the interpretation mode the compilation does not occur. So time and memory is not used. It is very important, especially when a report has a great number of components. However, it should be noted that this mode is relatively new, so you may have some issues with this. For example, incorrect handling of complex expressions. Also scripts, used in the report events, are not working in this mode.

Connecting assemblies

Another method of increasing the speed of report building and reducing memory usage is a compilation of the report as an assembly - .dll file. The main advantage of this method lies in the fact that the compilation occurs only once. The next time already compiled report is loaded. There is one issue with this. When updating to the latest product version, you have to re-compile a report from a template (.mrt file) into the assembly. Otherwise some errors may occur.

Working with the Table component

Table is a compound component. If you render complex reports, it is better to replace it with a band, because the Table consists of a set of items and rebuilding of each item involves a number of checks by all the other items and, if your report has a complex structure, some issues may occur with wrapping and breaking table cells. This component is good to create reports fast, but it slows the rendering process. It can be used in creating simple lists reports and reports without a very complex structure. In other cases it is desirable to replace it with a band.

Table Band
Optimization is a vexed problem today in nearly all areas of human activity. Unfortunately, there is no exception in reporting. How to most effectively make the process of designing, rendering, and processing reports? Today, these questions concern the majority of users of all reporting products.

Optimizing reports is a set of actions aimed at improving the system and process of working efficiency with the reporting software. Stimulsoft Company offers some useful hints, following which, you will not only save time taken to generate the required reports, but, in general, increase productivity of your staff.

As for designing reports, the optimization here lies in two directions: increasing the speed of report rendering and reducing memory usage.

Data

To increase the speed of rendering reports it is necessary to request only needed data from large databases. That is, if for the report you need, for example, only a few tables and fields, then there is no need to add to the dictionary data all the data available in the database. Otherwise, huge amount of resources will be spent on it to get all the data, not to mention the time spent. Also, it would be logical to use a WHERE construction in SQL. In case you do not need all the fields and records from a table, etc., but only the ones corresponding to specific conditions. But these conditions should be subscribed in the SQL filter, but not in the filter of the Data Band. Using the filter, only a small part of records in the table is displayed. Those records are requested. This applies positive effect on performance.

Also, you can set the SQL Query value to the Filter Engine property of the Data Band. This automatically adds the WHERE condition directly to the SQL query.

Dictionary

Images

Another more important thing in optimizing the process of rendering reports is optimization of images. In most cases, high resolution of images used in the report and their very high quality is not required due to the fact that to view the contents of the report, including the images, a computer monitor or a laptop is used. To reduce memory usage, reduce the size of images to the appropriate size. The best option is to get the desired result without using the Stretch image property.

Stretch image

Rich Text

The ability to use several common custom components instead of the RichText component. Since the RichText component is complex some issues with processing may occur. For example in Web, where the RichText editor is not present. So the RichText component is exported to an Excel file as a picture. After that, there are certain difficulties in editing and exporting the whole document.

Rich Text

One Page

When rendering a report, sometimes all the components are not placed on the same page. Typically, users transfer excessive ones on the next report page, group them by one Data Band on one page, or use the Sub-Report component. This is time-consuming.

To increase the speed of rendering reports, we propose to use the Large Height property, which increases your page to a required size.

The property will increase the page in the design mode, and the mode of viewing the report will not “suffer”.

Grouping

In order to increase the speed of rendering the report you should remove unnecessary groups from the rendered report. For example, grouping by the GroupHeader component. Users group by several categories: ID, Name, Description, and so on, but grouping is enough by the category ID. It is also possible to define complex conditions for grouping, i.e. to create grouping based on multiple fields of conditions. All conditions can be combined into a single group. In this case, instead of 5-6 GroupHeader components, you only need one component. This will speed up the construction of the report and simplify its structure.

Grouping
Some time ago we have changed the main menu of our products. It was made for our users who now can work with our products more easily. In this article we want to give you some information about the changes.

From the main menu we have removed the next buttons: "Open Page", "Save Page As", "Delete Page", since they were duplicated.

All these actions you can make by right click the tab.

Items

Also we could note other changes:

- the button Watermark was added to the tab Page.

Items

- we have hidden the panels Watermark Text and Watermark Image.

Items

- the tab View can now be found in the tab Page.

Items
Items

- in the context menu there are two new items “Open Page” and “Save page As”.

Items

- almost each element of the menu has now a tooltip. For the tooltip be displayed you should hover the cursor on an icon of the element.

Items

In addition, after the conversion of the designers menu we have decided to disable by default the buttons Save\Load in\from GoogleDocs.

To make these buttons visible use the following properties:

StiOptions.Designer.Ribbon.ShowMainMenuReportOpenFromGoogleDocs
StiOptions.Designer.Ribbon.ShowMainMenuReportSaveAsToGoogleDocs
When a user migrates from Crystal Reports on Stimulsoft Reports, this may cause some issues related to the differences between methods of designing and rendering reports. The most frequently asked questions in this regard will answer the head of technical support Stimulsoft Reports, Ivan Shmatov.

"The first major difference is working with data bands. The data is displayed in a report from the data source using a data band. In the reporting tool Crystal Reports on the same report page only one data band can be placed, so it is possible to use only one data source. In software products Stimulsoft Reports the number of data sources, you can work with in the report, is not limited. For example, when designing the Master-Detail report, you should use at least two data sources - master and detail. In Crystal Reports, the construction of this type of reporting is possible using sub-reports and scripts. In our products all the data sources can be placed on a single page and no additional scripting is required.

The second difference is different specialization of components. Plain text, expressions and fields of data sources have different components in Crystal. In Stimulsoft Reports a TextBox component is used. In this component you can combine regular text and expressions in any combination.

Another difference is using different syntax of expressions and scripts. Crystal Reports uses Visual Basic, while Stimulsoft Reports uses C# (by default) and Visual Basic.

The third important difference concerns data sources. For example, you create a report using a test database, and then you need to replace a data source in a report on the source of a different type. In Crystal Reports, when clearing the current data source, all the fields are cleared from the page. In Stimulsoft Reports you can remove all sources in the dictionary but required data will remain on the report page.

Our reporting tools have a grid - linking fields. When you drag a TextBox component you can use this grid to bind the component to a report page accurately and quickly. For this, select a component and click "Snap to Grid". Crystal Reports has no grid, only a Grid Lines component, by means of which it is not possible to accurately define the size of the TextBox.

Designing of the table, too, has some differences in the various reporting tools. Since Crystal Reports is quite difficult to place components in neat rows, users generally put a textbox as it will, and then draw borders with shapes. Users that migrate to Stimulsoft, often try to do the same, but we have a simpler way. You can use the margins of text components. You can also use the special cross-primitives - horizontal and vertical lines, and rectangles. It is possible to create tables using the Shape component, but one should make a reservation that Shape – is rather “heavy” component for exports, so that it is easier and faster to use primitives created especially for tables.

Our developers created an importing tool - a special application that allows you to convert reports from Crystal Reports to Stimulsoft Reports. Reports created in Crystal Reports, have its own internal format, which eliminates the possibility to open and view them in our tools. They can only be opened with help of API Crystal Reports. Before working with the importing tool you need to install Crystal Reports and recompile the converter specifically for working with the current version of the reporting tool. Please note that through the API Crystal Reports, not all the properties of the components are available, therefore, the converter only converts the properties available to it.

A few words about the properties of components

Properties of the components can be “not calculated”, that is, the value of which is set to a particular value; and “calculated”, the values of which are set by the expression and calculated each time they are accessed. In Crystal Reports, you can add a script to various not calculated properties, the result of execution of which is controlled by this property, i.e. actually turn the property into a calculated one. In our products, properties are clearly divided into calculated and not calculated. So, when converting a report, some logic of the report can be lost.

To solve this issue, you can use special events of components - BeforePrint, AfterPrint, Rendering, GetData, etc. They allow you to achieve almost the same result, but in other ways. Unfortunately, automatic converting of scripts from CR into our product does not work because there are differences in the data structure, engines, etc.

Differences in licensing policy

There are many differences between products by Stimulsoft Reports and Crystal Reports not only in functionality, but also in the licensing policy. Says Executive Director of Stimulsoft Company Andrew Savin: “First of all I would like to say, that the licensing of Stimulsoft products has two main advantages: minimum limitations and easiness in understanding”.

Crystal Reports provides the license for a named user. It means that the license is assigned to the specific user. Stimulsoft Reports license is per company, it means the license may be transferred to other developers within the company.

Crystal Reports allows the unlimited using of product within the company, when you develop the product only for internal using, then it is enough for you to have a license for your developers. The license you purchase in Stimulsoft relates not only to actions within the company, but even when to transfer your application to the third party.

Another difference: for example, the company creates the application and shares it to the third party. In this case the application must be provided with the Crystal Reports license. It is allowed to integrate in Rich Internet Applications 750 license free components for modification, previewing and printing of reports with free distribution and delivery of application to the third party. Stimulsoft Reports license does not have such limitations.