Skip to main content

XLSX, XLS or CSV as Datasource in Jasper Report

Welcome again !!!

Today v'll be learning how to create data source using Excel or CSV sheet and generate Jasper report.

Kindly follow below simple steps to fulfill your requirements.


Step 1 : Create CSV / Excel file Using Microsoft Excel or other applications which supports extension of .csv / .xlxs / .xls formats.
    


Step 2 : Create Blank Jasper Report using 'One Empty Records Empty Rows' as Data source.




Step 3 : Go to Repository Explorer Window > Data Adapters > Create Data Adapters.



Step 4 : We can select 'CSV File' for accepting CSV format file as datasource or 'Microsoft Excel (xls, xlsx)' for accepting XLSX or XLS format file as datasource.



Step 5 : Add the settings as shown in the below image for both the xlsx, xls and csv format :
If the first row in CSV, XLSX files are the column names identifying the definition of records, check 'Skip the first line (the column names will be read from the first line)'


Step 6 : Select Dataset and Query Editor from Report Properties as shown in image :



Step 7 : Select the Adapters which was created for CSV and XLSX / XLS Files.
Also select csv / xls from language options respective of file types and adapters selected.
Field names will be displayed as soon as we clicked on the 'Read Fields' button.


Step 8 : Design reports with the field fetched from datasources


Step 9 : Preview and export it to various formats as required by selecting datasources created in Data Adapter.


That's it..!!!

Hope it was useful.

For more queries Contact me on : miwagada@gmail.com

Visit Again...:)

Comments

Post a Comment