'How to add header in exported CSV file in react-bootstrap-table

I would like to add a couple lines as header on top of the exported CSV file in react-bootstrap-table

Like this one: Like this one I've gone through the docs but still no idea how to do so.

Here is my code sample

              <ToolkitProvider
                keyField="id"
                caption={<CaptionElement />}
                data={attendanceReportData || []}
                columns={columns}
                search
                exportCSV={{
                  fileName: currentUser?.organization + "-" + deptName + ".csv" ,
                }}
              >
                {(props) => (
                  <div>
                    <BootstrapTable
                      {...props.baseProps}
                      remote={{
                        pagination: true,
                      }}
                      onTableChange={onTableChange}
                      pagination={paginationFactory({
                        page: page,
                        totalSize: totalPages,
                        hideSizePerPage: true,
                      })}
                    />
                    <ExportCSV {...props.csvProps} />
                  </div>
                )}
              </ToolkitProvider>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source