PPM Excel Report - Filter not working

Hello, I need help with Excel report filters. I am running the report with filters, but the query still returns data in Excel without applying the filters. I have the following code in my Excel:

<jt:forEach items="${datasources.get('dsPlanilhaOrcamentaria').addFilter('FRENTE_MISSAO', P_FRENTE_MISSAO).addFilter('CICLO', P_CICLO).getData()}" var="report">${report.FM}

My data source has the following filters:



My report includes the following filters and commands:

Am I doing something wrong that is preventing the filters from executing correctly?

Thank you.
  • Verified Answer

    0  

    Hi Nivaldo,

    The token in your report reads "CICLO" (just like the token in the datasource), yet in the excel template you pass a parameter named "P_CICLO". Why did you add a "P_" at the beginning exactly? It's a common practice to start all tokens in report parameters by "P_" but it's not required at all, like you demoonstrated. 

    So try to replace:
    .addFilter('FRENTE_MISSAO', P_FRENTE_MISSAO).addFilter('CICLO', P_CICLO)

    with:
    .addFilter('FRENTE_MISSAO', FRENTE_MISSAO).addFilter('CICLO', CICLO)

    and see if that works better.

    For information, you can easily see what parameter names & values are available to be used in your template code by setting replacing DEBUG=false with DEBUG=true in your report type command steps. This will ignore your template and instead list all the parameters passed to your template in the generated XLSX file, it can be very useful to make sure which are the exact name and values that are available to your template.

  • 0 in reply to   

    Hi Etienne. 

    I made the changes as you suggested, validated them through DEBUG, and it worked.

    Thank you very much!