Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82367

I had issue, when extracting the tables values has CSV file ?

$
0
0


when i click the export button to extract the tables values has CSV file only table headers was reflected in csv file . Iam server side processing data table in angular 7 this is my code .

const that = this;

this.dtOptions = {
  pagingType: 'full_numbers',
  responsive: true,
  serverSide: true,
  processing: true,
  scrollY:500,
  ajax: (dataTablesParameters: any, callback) => {
    this.noOfRows = dataTablesParameters.length.toString();
    const page = parseInt(dataTablesParameters.start) / parseInt(dataTablesParameters.length) + 1;
    this.pageNo = page.toString();
    dataTablesParameters.PageNo = page.toString();
    dataTablesParameters.NoOfRows = dataTablesParameters.length.toString();
    dataTablesParameters.SearchValue = dataTablesParameters.search.value;
    dataTablesParameters.sortHeader = this.sortHeader;
    dataTablesParameters.sortOrder = dataTablesParameters.order[0].dir;
    that.http
      .post<DataTablesResponse>(
        this.config.integrationGridList,
        dataTablesParameters, {}
      ).subscribe(resp => {![](https://datatables.net/forums/uploads/editor/yt/siwruqpmlyba.png "")

        that.tableData = resp.result.lists;
        callback({
          recordsTotal: resp.result.totalRowsOfTable[0].totalCount,
          recordsFiltered: resp.result.totalRowsOfTable[0].totalCount,
          data: []
        });
      });
  },

  dom: 'lBfrtip',
  buttons: [
    {
      extend: 'collection',
      text: 'Export',
      buttons: [
        'copy',
        'excel',
        'csv',
        'pdf',
      ]
    }
  ],
  columnDefs: [
    {  data: 'Company' },
    {  data: 'FTP Host',width:'15%'},
    {  data: 'Ftp Incoming Directory' },
    {  data: 'Ftp Processed Directory'},
    {  data: 'Ftp Failed Directory' },
    {  data: 'Action', 'orderable': false, targets: -1},
  ],

};

Viewing all articles
Browse latest Browse all 82367

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>