Okay
  Public Ticket #3732563
Report Data Filter Issue
Closed

Comments

  • Aiden started the conversation

    I have issue of the downloaded report data doesn't follow the filter of the data source from wpDatatables. Even I've filter in wpDatatables, the downloaded report will still showing all data. 

    Attached files:  Screenshot 2024-09-26 at 11.28.47 AM.png
      sales (2).xlsx

  •  1,845
    Miloš replied

    Hi Aiden,

    Did you enable the option on your Report Wizard/settings "Report data filtering"?
    8498639203.png

    As pointed out on this Documentation,

    when we activate the option to "Follow table filtering" –

     this checkbox is visible only if you choose a wpDataTable data source on previous step.

     

     If this is checked, the report will always contain only the rows that are currently visible in the wpDataTable when it’s placed on the same page, in the same order. 

    So if a table is sorted, filtered, etc., the rows will be used in the report same as they appear on the page.

     If this checkbox is unchecked, or if the wpDataTable isn’t present on the same page with Report controls, whole table will be used in report every time. 

    Important to note : if the table has more rows that are currently visible, the invisible ones won’t be used in the report if the follow table filtering is enabled – to use them you would need to select “All” in wpDataTables “Show … rows” dropdown on the front-end.

    5228334886.png

    Let me know if perhaps that option was not enabled before - does that resolve the issue?
    Thank you.

     

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Aiden replied

    Hi Miloš,


    I've followed documentation guide but still not able to get the right result. Please have a look of my screen record -> wpDatatables_SS.mov 

  •  1,845
    Miloš replied

    Hi Aiden,

    Apology for the late reply.

    When we activate to "Follow table filtering" in a Report - this can only work on the front-end Page, when you set up the table shortcode on the same Page with the report download button.
    It is not possible to use this from the back-end download preview.

    As we explained in the Documentation
    7617260216.png
    So, when you do a preview of the download at the back-end, this always exports all table rows regardless of filtering - This feature only works when the report is used on the front-end, if you place its source Table on the same Page.
    Then it follows any filtering used in the table.

    Let me know if you try that, if you have any additional questions and if you encounter any issues with that functionality.
    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Aiden replied

    Hi Miloš,

    Thank you for your respond, it seem like a problem for me because my client requirement is required the report to be filtered when they download it. Is there any solution that my client able to download the filtered data. Their use case is to download the monthly sales report.

  •  1,845
    Miloš replied

    Hi Aiden,

    Yes, there is an easy solution, as explained, but it only works on the front-end on an actual WordPress Page.

    If you place the source table shortcode on the same WP Page with the Report shortcode - then a user can come to this Page and simply download the report.

    In that case, the Report is going to contain only the filtered rows from the table.

     

    If you need this to work in the same way when you hit 'download' from the back-end in WP-Admin, there is no way for the report to currently follow table filtering on the back-end or if you place the report on its own on a Page without the source table shortcode. In that case, as explained on the Documentation, the report can not follow the table's filtering.

     

    If you wish to pre-filter the source table and hide the actual table on the Page, while just visually seeing the Report and having that 'follow table filtering' functionality - There can be a workaround with CSS to achieve this.

    Now, we haven't tested this yet, so we can't guarantee if the report can 'see' the rows when the source table is hidden via CSS - but in theory, it could work. It is my custom idea if you wish to hide the table and just leave the Report to download the pre-filtered data hidden by CSS.

     Here are the instructions if you wish to try it :

     

    As mentioned above - by default, the report will not follow any filtering from their source table if you just put the report shortcode "on its own" on the page.

    But If you place the source table together with its report on the same page,

    and activate " Follow Table filtering"  on the Report Wizard settings,  it is going to follow any filtering you do on the table.

     

    Now, depending if you wish to hide the table and have a filtering for the Report, we can have two workarounds available.

    1. If you wish to hide the entire table along with table filters;

    you can add this CSS to the table's back-end settings/Customize/Custom CSS.

    .wpdt-c .wpDataTables.wpDataTablesWrapper {
    display: none !important;
    }

    This will completely hide the table from the page, but you can still pass the table shortcode with the Report, and you will get the "follow table filtering" effect on this report.

     

    2. Or if you wish just to hide the table while leaving the filters with the report,

    we would first need to disable the following in the table settings:

    "Show X entries" drop-down; "Info Block" from Display tab:

    5739555450.png

    Then, "Enable main search block"  and "show filters in a form above the table" from the Sorting and Filtering tab:

    7822122957.png

    Then, you can add this CSS in the table settings/Customize/Custom CSS:

    .wpdt-c .wpDataTablesWrapper table {
    display: none !important;
    }
    

    That will just leave the report visible with the filters on the page,

    if you pass both table and report builder shortcodes.


    I hope this clarifies the functionalities, and how you can easily download the filtered report.
    Let me know if you have any questions.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Aiden replied

    Hi Miloš, 

    It sounds good for me. Will try your suggested method. Thanks alot! 

  •  1,845
    Miloš replied

    Hi Aiden,

    You're welcome, I am happy to help.

    Let me know how it goes when you try out one of the suggested methods and if you encounter any issues.

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables