Mega Code Archive

 
Categories / Delphi / Examples
 

Which Report Generator is the Fastest

Title: Which Report Generator is the Fastest? Question: Which Report Generator is the Fastest? Answer: Which Report Generator is the Fastest? Why is it the Fastest Report Generator? Route and Co-runners Survey Head Start! Are there any Traffic Jams? Forward! Finish! Who is the Winner? Meanwhile Backstage Why is it the Fastest? I think everyone who faced the choice of choosing a tool for report generating had a question: how to choose the right tool and what to compare? Should it be chosen according to its size? And what size? For example, according to that one which will be added to your application? There are report generators which do not add anything to the application and are stored in a separate dll-file, the size of which is much bigger than the application file. Or remember such a situation when not much is added to the executable file, but report files are of bigger size than the application Or should it be chosen according to the report file? Probably, it will be more weighty factor, but not decisive at the same time. Should it be chosen according to convenience for the user? How can it be measured? Or should it be chosen according to the speed of report generating? Or, must the speed have decisive importance, taking into account the speed of modern processors? It turned out to be true. Not every application generates only one simple report at the end of the day. If an application must be distributed, multi-used, probably then the generation speed and report compactness would be decisive. Usually a user sorts out such an instrument as if he/she selects a spouse - once and for a long time. That is because it is mugs game to learn a new tool for each new project. This choice is very excruciating and not everyone is able to find strength and time to scrupulous comparison (after all, it is necessary to investigate each tool). Having faced this problem I decided to cope with this issue once and for all. After I have seen the results of comparing the work speed between two report generators included into Borland Delphi pack (Quick Report and Rave Reports) I arrived at an idea: Which results will other popular among the programmers report generators show?. When I got the sources of the above-described test, I decided to extend this test not only with the help of new test competitors but also via test range broadening (i.e. via adding new tests). Route and Co-runners Survey 6 popular report generators were chosen as co-runners: ? QUICK REPORT PRO 4.06 BY LOCHERT/QBS SOFTWARE LTD. ? RAVE REPORTS 7.0 BY NEVRONA DESIGN. ? FASTREPORT 3.23 BY FAST REPORTS INC. ? FASTREPORT 2.56 VCL BY FAST REPORTS INC. ? REPORT BUILDER 10.02 BY DIGITAL METAPHORS CORPORATION. ? CRYSTAL REPORTS 11.0 BY CRYSTAL DECISIONS INC. All skillful competitors are well-known to Delphi-developers. Developers usually choose exactly between them. It must be said that though they have not many visual differences (for example, you will switch from CRYSTAL REPORTS report designer to REPORT BUILDER or any other competitor rather easily), architecturally they differ much. QUICK REPORT It is famous by the fact that it is delivered within Delphi pack for a long time. Exactly it was delivered. Since Delphi 7 this pedestal was occupied by Rave Reports. It is one of the oldest products, which in principle must be more stable. RAVE REPORTS Earlier it was called Report Printer. Its new name it acquired with the visual report designer (previously this designer was called Rave). First it was just generator of reports which were built up on the basis of code. It was not designed for bands. It must be said that it is obvious. The visual part is badly worked-out between all competitors. FastReport Having examined FastReport 2 and FastReport 3 carefully I can easily state: two versions of one product differ ideologically as two different products! Guys from FastReports seem to consider this issue rather seriously their statement about remade and perfected architecture in FastReport 3 is rather unpretentious. In spite of the fact that there is much common in them because all the objects are in-circuit report generator objects (in this respect FastReport is closer to CrystalReports), they have many differences as well common in-circuit script in the third version and separate scripts for each object in the second version, the third one has much more capabilities, four different script languages support, dot-matrix printers support (among the compared competitors such wide capabilities has only FastReport) etc. There is even a converter from the third version into the second one (note that other competitors do not make such drastic format changing! It has some drawbacks the transfer from version to version is not always simple, it is better to choose the third version. According to format it is the newest generator which has no remains and artifacts reports are stored in XML. This may serve as a guarantee of format stability and readability). Judging by the dynamics of development, it is the most dynamically growing product. REPORT BUILDER Previously this project was called PiParty. For a long time it was the undisputed leader among report generators for Delphi. It should be mentioned that this product releases a new version right after the new Delphi version (that is why the version numbers coincide). Still, one wants more real changes and improvements between versions and not only Supporting the new Delphi version. It is particularly well seen on the background of the FastReport (this is my opinion!) CRYSTAL REPORTS The most experienced competitor. Some know it as ReportSmith due to Delphi 1. By6 virtue of age it is rather large and difficult in integration. Without making allowances for its age we place the competitors abreast. Again Borland included it into its product, Delphi 2005. The situation with Delphi 2006 is not clear at the moment of writing the article I decided to shorten all tests to 4 stages: ? Simple two-paged report building and saving to file via 6 DB fields. ? Complex fourteen-paged report building and saving to file via all DB fields. ? Complex fourteen-paged report export to Acrobat PDF via all DB fields. ? Complex fourteen-paged report export to HTML via all DB fields. Head Start! To get more precise test results each report generator performs stage task 100 times. The time of performing one report is not calculated owing to absence of necessity, since place arrangement will not change because of dividing by 100. To get average test results and exclude processor architecture influence, testing was provided via two PC of the following configuration: 1. AMD Athlon XP 3200+ , 1024 RAM; 2. Intel Mobility Pentium M 1.7 , 512 RAM. Program sources are available here: Lets go! Are there any Traffic Jams? Such problem as usage convenience and elementary portability proved to be rather relevant. On program start on another PC revealed the following: Crystal Reports requires availability of installed kit for application functioning, otherwise there will appear an error that is not correct in relation to a user. Like true analysers, we are not afraid of difficulties. We will give it necessary libraries but that is inconvenient for a user and even rather burdensome. Moreover, such a situation may take place when there is a Crystal Reports version installed on the users PC, which is different from the required one. Then there will be troubles . I would like to draw CR users attention to the following: - on installation of the current CR version, other programs using other CR version will stop their work in likelihood of 99% and result in error. - and without installation the current program will not operate and will result in error. I faced that when I tried to run a program with CR 10.0 version on the PC with the 9 CR version. If you are in some doubt about it, you can try. Finally the work with CR was remade in the system and the verification of the CR installed on the PC was started. There is unpleasant news for QR users too. On export into PDF there appears memory leak for Quick Report Pro 4.04 during which 250 Mb RAM are not cleared. That leads to incorrect operation of other programs. This problem is solved in the last version of the last version of the product (such a problem does not appear in 4.06). Also I did not like the Rave Reports achievement of visualization: a user, who had not enough experience in working with this product, will have problems in creating a report. Especially this problem touches upon the work with databases. I faced such problems when I spent almost the whole day building a simple report with databases. Fast Report 2 has no export into PDF. That is why it will not participate in the third test, though acting in advance, I would like to study its results in this test. Forward! Let us proceed to the testing. The 1-st stage. In this test all competitors perform the following task: to create and store a simple report consisting of 2 pages. To fill it we use 6 fields from the DB included into any version of program environment by Borland - customer.db. Competitor Run time Derivable file size PC #1 PC #2 Average Quick Report 2.969 2.523 2.746 106 KB Rave Reports 2.140 2.364 2.252 3.77 KB + 14.4 KB Fast Report 3 0.734 1.051 0.893 0.251 KB Fast Report 2 1.109 1.032 1.070 34.3 KB Report Builder 4.234 4.236 4.235 72.3 KB Crystal Reports 12.281 20.834 20.783 15 KB The 2-nd stage. In this test all the competitors perform the following task: to create and store a complex report consisting of 14 pages. To fill it we use all fields including graphical ones from the DB included into any version of program environment by Borland - biolife.db. Competitor Run time Derivable file size PC #1 PC #2 Average Quick Report 10.875 10.345 10.610 1.32 MB Rave Reports 13.124 20.519 16.820 4.62 KB + 1.08 MB Fast Report 3 9.703 11.307 10.505 2.10 MB Fast Report 2 4.422 3.004 3.713 519 KB Report Builder 13.969 11.677 12.823 1.15 MB Crystal Reports 24.141 25.085 24.613 156 KB The 3-d stage. In this test the competitors perform the following task: to export a complex report consisting of 14 pages into PDF. To fill it we use all fields including graphical ones from the DB included into every version of program environment by Borland - biolife.db. Competitor Run time Derivable file size PC #1 PC #2 Average Quick Report 1072.796 654.411 863.604 248 KB Rave Reports 60.954 48.980 54.967 515 KB Fast Report 3 98.577 92.193 95.385 434 KB Fast Report 2 Report Builder 121.781 40.919 81.350 3.11 MB Crystal Reports 250.750 251.260 251.009 156 KB The 4-th stage. In this case all competitors perform the following task: to export a complex report consisting of 14 pages into HTML. To fill it we use all fields including graphical ones from the DB included into every version of program environment by Borland - biolife.db. Competitor Run time Derivable file size PC #1 PC #2 Average Quick Report 68.845 50.302 59.569 128 KB + 360 KB (pictures) Rave Reports 354.062 517.104 435.583 340 KB + 35.2 MB (pictures) Fast Report 3 26.656 25.797 26.227 76.6 KB + 7.21 MB (pictures) Fast Report 2 25.453 74.698 50.076 47.8 KB + 11.2 MB (pictures) Report Builder 340 KB + 35.2 MB (pictures) Crystal Reports 225.031 226.102 225.567 197 KB + 20.2 MB (pictures) As a result of this test there appeared the following issues: On export into HTML for Quick Report the images exceed the block bounds. Consequently export image size does not coincide with its size in the source. On export into HTML for Rave Reports there appears an HTML-page for each report page. Consequently new image files are created for each report (28 images 100 recurrences = 2800 image files). That leads both to additional disk space expenditure and extra time for export. On export into HTML for Crystal Reports new image files are created for each report (28 images 100 recurrences = 2800 image files). That leads both to additional disk space expenditure and extra time for export. Finish! Test Results In the first test the 1-st and the 2-nd places are taken by the products by Fast Reports Inc. The third place is occupied by Rave Reports with the 110.5 % gap. In the second test the 1-st and the 2-nd places are taken with the sufficient gap by the products by Fast Reports Inc. The third place is occupied by Quick Report with the 1 % gap. In the third test the 1-st place in taken by Rave Reports. The second one is taken by Report Builder with the 48 % gap. On the third place Fast Report 3 is resting with the 17 % gap. The fourth test ended again with the victory of products by Fast Reports Inc. the third place is occupied by Quick Report with the 19 % gap. Who is the Winner? According to the results of the four tests the first and the second places are won by Fast Report Inc with its products: Fast Report 3 Fast Report 2. the third place is occupied by NEVRONA DESIGN with its product Rave Reports. With the minor gap the fourth place is taken by LOCHERT/QBS SOFTWARE LTD with its product Quick Report Pro. Next comes DIGITAL METAPHORS CORPORATION with REPORT BUILDER 10.02. The last is CRYSTAL DECISIONS INC with CRYSTAL REPORTS 11.0. Meanwhile Backstage According to test results and personal impression during program making practically all report generators have their weak spots. The process of report building in Crystal Reports revealed that it is impossible to call designer from the program environment neither for new report building nor for ready report editing. Moreover, report building seems to take place during the stage of its building in designer. The following idea is based on the fact that practically equal time passes on opening reports of different complexity. That is why it is practically impossible to edit an open report. Thus, the veteran of report generators market requires not only own libraries but also it is large and clumsy. Moreover, there is practically no documentation on working with report in program code. As a rule, there are descriptions for CR versions. Usually they are created only for definite versions and are not complete just explaining how to create a report in the designer and nothing more. Quick Report, which differs form others, requires creating of a separate form containing its report. That is not very convenient for the user. Moreover, there is, for example, a necessity to perform a report output on band doubling, which includes two sheet copies. Here only one of them is displayed in preview window and on export. Report Builder requires DataSource component (from Data Access palette) besides ppDBPipeline for connection to DB. That is not convenient for the user. Moreover the component does not support an export to HTML. For performing that the developers advise to use exterior components, such as TExtraDevices by James Waler and TcdHTML Device by Cyberdyme Data Systems, which are not free for charge. Such a treatment of RB users unpleasantly surprises. Having bought the product which price is equal to that of other report generators, you also need to buy separate components for performing export to HTML. Other products have own export methods. Besides the above-mentioned unsuccessful realization of visuality Rave Reports has such an undocumented capability (namely, it performs an operation concealed from the user: on running a report it saves a dump of the prepared report in *.ndr file. Moreover, it is necessary to add RvNDRWriter component for proper Rave Reports operating, otherwise nothing works. Anyway, one can bear with it, but the most interesting fact is that export cannot be performed without using this file. Other products do not require an additional file. The only reasonable explanation of requirement to have this file is the supposition that there is a somehow reformed report in this file. And it makes the work with its export easier. There are problems with exports in FastReport too. For example, there are three components in FR 2 for export to HTML what for? The first reproduces the document appearance incorrectly, the second has no drawbacks it is the most optimal. I was not a success with the third method, that is why nothing good or bad I can say about it. Of course, FR 3 has the priority in Fast Report Inc. And such a number of exports is probably concerned with debugging of different algorithms and choosing the best for using in the 3-d version. If you select frxDBDataSet (it is used, for example, on band filling), then in preview mode the application will display the following error: Unable to use the same DataSet for report and band. The same error is displayed on installation of the frxDBDataSet for a page. How could it be? Either a page or a band on the page does not belong to the report. The appearance of such a mistake is unexplainable. So the export speed of the PDF leaves much to be desired. 2006 Sergey Medvedev