Export Database Table to Excel in Talend

In this section, we show how to use tFileOutputExcel to export database tables to Excel in Talend with an example. For this tFileOutputExcel demo, we are using the SQL Database table, and the data inside this table is

Export Database Table to Excel in Talend 0

Talend Export Database Table to Excel File example

From the below Talend image, you can see that we established a SQL connection with and selected the Customer table using the DBInput.

Export Database Table to Excel in Talend 1

Next, drag and drop the tFileOutputExcel output field from the palette. As you can see from the tooltip, the Talend tFileOutputExcel writes the cell’s row by row in a Microsoft Excel file.

Export Database Table to Excel in Talend 2

Please connect the DBInput source to tFileOutputExcel. The following screenshot shows the list of available options in the Talend tFileOutputExcel component tab to export database table to excel file.

  • Write excel2007 file format (xlsx) – It writes the output in 2007 format.
  • Include Header: Do you want to include the header names or not?
  • Append existing file: Do you want to append the data to an existing file or not?
  • Changing the font style.
  • Do you wish to auto-size the columns or a few of them by checking the boxes beside them?
Export Database Table to Excel in Talend 3

By default, the tFileOutputExcel field selects the default location and out.xls as the file name. Please click on the browse (…) button to select the existing file or create a new Excel file. Here, we are creating the Customers_Excel.xls in the Output files directory.

Export Database Table to Excel in Talend 4

Next, we selected the Font as Courier New.

Export Database Table to Excel in Talend 5

And Define all columns to auto-size option.

Export Database Table to Excel in Talend 6

You can see all the options that we selected for this example in the below screenshot.

Export Database Table to Excel in Talend 7

Next, click the Edit Schema button to check the Talend tFileOutputExcel schema.

Export Database Table to Excel in Talend 8

Let me run the Talend tFileOutputExcel job to see whether we exported Database Table to Excel File.

Export Database Table to Excel in Talend 9

You can see the output file generated by the Talend tFileOutputExcel job.

Export Database Table to Excel in Talend 10