Tuesday, 26 March 2013

NextReports: Get data from text files

NextReports 6.1 will allow to create a data source for CSV files. Using a CSV JDBC driver , users will be able to create reports and charts simply by providing data inside a csv file. Data source url contains the directory path where csv files are found:

There are some special properties which can be edited using driver properties:

You are not restricted to csv files, you can use any text file in which data is separated through a special separator. Csv file may contain the columns names on the first row, but generally those names should be specified in driver properties. Here user can also define the types for columns choosing between Int, String, Double, Boolean and Date.

Lets say, as a simple example, we have a simple csv file like the following with balance accounts for some persons:


When we connect to the CSV data source we will see the csv files from that folder as tables and we can use them to create a report just like with any database data. The only restriction is that a query must be done on a single csv file. We cannot make joins between such tables.

We could make a simple report to compute the sum of balances:

We can also see that empty fields are correctly interpreted depending on the defined types:

1 comment: