Overview
Version
Report Server Version |
---|
11.0 |
Application Scenario
Most system-generated log files are TXT files, such as files showing website visits and the dwell time on each page.
Therefore, it is necessary to analyze TXT files in the FineReport system. You can import TXT files as data sources under Server Dataset > File Dataset.
Function Description
Text datasets refer to the datasets whose data sources are a series of TXT files.
The admin can use FineReport to present data and perform data analysis with these files as data sources.
Defining the Text Dataset
TXT File Preparation
TXT files consist of texts and separators.
Supported text encoding types (empty by default) include: GBK, BIG5, ISO-8859-1, UTF-8, UTF-16, EUC_JP, EUC_KR, and CP850.
Supported text separators include: Tab, Space (default separator), Comma, and other custom separators.
For example, the prepared TXT file whose encoding format is empty and separators are commas is as follows.
Name,Capital,Continent,Area,Population
Argentina,Buenos Aires,South America,2777815.00,32300003.00
Bolivia,La Paz,South America,1098575.00,7300000.00
Brazil,Brasilia,South America,8511196.00,150400000.00
Canada,Ottawa,North America,9976147.00,26500000.00
Chile,Santiago,South America,756943.00,13200000.00
Colombia,Bagota,South America,1138907.00,33000000.00
Cuba,Havana,North America,114524.00,10600000.00
Ecuador,Quito,South America,455502.00,10600000.00
El Salvador,San Salvador,North America,20865.00,5300000.00
Guyana,Georgetown,South America,214969.00,800000.00
Jamaica,Kingston,North America,11424.00,2500000.00
Mexico,Mexico City,North America,1967180.00,88600000.00
Nicaragua,Managua,North America,139000.00,3900000.00
Paraguay,Asuncion,South America,406576.00,4660000.00
Peru,Lima,South America,1285215.00,21600000.00
United States of America,Washington,North America,9363130.00,249200000.00
Uruguay,Montevideo,South America,176140.00,3002000.00
Venezuela,Caracas,South America,912047.00,19700000.00
TXT File Upload
Text datasets support two methods for calling TXT files. You can select one as needed.
1. Local file: TXT files are stored in FineReport installation directory\webroot\WEB-INF\reportlets of the FineReport project. (You cannot obtain files from other directories of the local PC.)
2. Remote URL file: TXT files are stored on a server. You can call the files by accessing their URLs.
In this example, the created TXT files are placed into FineReport installation directory\webroot\WEB-INF\reportlets, as shown in the following figure.
File Dataset Adding
1. Click + and select File Dataset, as shown in the following figure.
2. On the File Dataset setting page, select the TXT file to be added. The following figure shows the effect.
Since datasource.txt (where commas are used as separators) contains column headings in the first row, you need to select the corresponding options according to the actual needs on the right setting panel. You can select Others to customize the separator.

1. If you select URL, ensure that the FineReport project can successfully access this file. Otherwise, the call will fail.
2. If you select URL and the selected URL contains Chinese characters, you must encode the URL first. You can enter the encoded path to enable normal access.
3. Click Preview. The following figure shows the data.
4. After successful creation, the corresponding text dataset is displayed in the Template Dataset panel.