Connection to a huge database CSV

2017-04-30

Not so long ago in FastReport .NET was added the ability to load data from a csv file. In other words, a CSV file can now be used as a data source.

This was done after some time from one of the users entered an interesting query to a support. He claimed that he has a CSV file that does not open, instead, an error message appears. The user kindly provided this file for testing.

At first glance, it was thought that the file too is big, that is the reason why it can not be opened. But upon further examination it was revealed that the problem is not in the size of the file. As it turned out, the file does not entirely correspond to the CSV specification. In the file rows were found that did not contain separators. Apparently, they are used as comments, with any data yourself.

It was decided to ignore such lines when data is loaded. As a result file has become loaded without any problems.

It would seem that the problem is solved and we can settle down, but the idea of a large csv file did not give a rest. After some searching there was found a really huge file. This file size was 441 MB, seemingly not very awesome, but, nevertheless, it consisted of 31 columns and 2 458 525 lines.

Testing this download brought dual results. On the one hand, the file opens that undoubtedly pleased. But it was a very sad fact that the file download took nearly half an hour.

It is known two solutions to this problem. However, buying a new computer is not a good idea. Therefore, I had to spend some time to optimize the code. As a result, the file download has been achieved within two minutes

November 20, 2024

Localization and Language Switching in FastReport VCL

FastReport VCL supports 40 languages for interface localization and allows you to change the language on the fly through menus or code, without recompilation.
November 01, 2024

New Features of the FastReport VCL Editor

We are considering new features of the report editor: extension lines, highlighting of intersecting objects, updated report and data trees.
October 30, 2024

Using Styles When Creating Reports in FastReport VCL

The article discusses one of the new features of FastReport VCL — the use of styles and style sheets.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2024 Fast Reports Inc.