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

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

hemanthkumarhemanthkumar Posts: 6Questions: 2Answers: 0
edited July 2019 in Free community support


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},
  ],

};

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @hemanthkumar ,

    At a glance, everything looks OK. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • hemanthkumarhemanthkumar Posts: 6Questions: 2Answers: 0
    edited July 2019

    when i Debug my page the following result was displayed . I didn't were the error was spotted . any body here to help mee?

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.