Individual column input select exporting all options

Individual column input select exporting all options

shatrughanshatrughan Posts: 87Questions: 16Answers: 0

I have filtered by table using Individual column input select in some footer columns. While exporting the table data to Print or Excel, all the dropdown data of those footer columns are also shown which is not required at all. Please suggest how to include the selected option only in exported data.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    This thread might help - it's doing something similar but for the header.

    Colin

  • shatrughanshatrughan Posts: 87Questions: 16Answers: 0

    The said thread is simply hiding the column itself but in my case I want to have dropdown filter in select footer columns. I have enabled footer export for Print and Excel where all the dropdown options are shown as a long string instead of reflecting the selected option only. Please help..

  • shatrughanshatrughan Posts: 87Questions: 16Answers: 0

    Data exported while printing.

  • shatrughanshatrughan Posts: 87Questions: 16Answers: 0

    Sorry, attachment missed.

    e-reporting.in/report_FCI.pdf

  • shatrughanshatrughan Posts: 87Questions: 16Answers: 0

    Please help @allan, I want to have dropdown filter in select footer columns. I have enabled footer export for Print and Excel where all the dropdown options are shown as a long string instead of reflecting the selected option only.

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    On this page, https://datatables.net/reference/button/pdfHtml5 , the first comment shows how to modify the footer. I haven't tried it, but it would be worth giving that a go.

  • shatrughanshatrughan Posts: 87Questions: 16Answers: 0

    Couldn't succeed... :(

  • colincolin Posts: 15,237Questions: 1Answers: 2,598
    Answer ✓

    Could you create a test case showing how far you've got - that would give us something to debug together.

  • shatrughanshatrughan Posts: 87Questions: 16Answers: 0

    Finally, succedded using the following code

    oTable.on( 'order.dt search.dt', function () {
    oTable.rows({search:'applied', order:'applied'}).every( function ( rowIdx, tableLoop, rowLoop ) {
    var data = this.data();
    data.Sr = rowLoop + 1;
    /*Sr is your index column, don't use your primary key or id as it could create problem in editing or deleting */
    this.data( data );
    } );
    } ).draw();

This discussion has been closed.