Support

Expand all | Collapse all

How to get result items/documents of filter in velocity report

  • 1.  How to get result items/documents of filter in velocity report

    Posted 07-13-2020 03:53
    Edited by Florian Giller 07-13-2020 07:03
    Hi all,

    how do I get all items/documents of a filter inside a context insensitive velocity report?
    I need a list just like $documentList in context sensitive reports, but of multiple filters.

    #set($contourFilterDao = $applicationContext.getBean("smartFilterDao"))
    
    $contourFilterDao.getSmartFilter(5900).getName()
    This code returns "Testfilter123" correctly.

    The SmartFilter Interface has not getter to retrieve results (SmartFilter).
    How do I get the result of the filter to, for example, iterate over it?

    Edit:
    Now I found the SmartFilterService but it did not work neither.
    #set($contourFilterDao = $applicationContext.getBean("smartFilterDao"))
    #set($smartFilterService = $applicationContext.getBean("smartFilterService"))
    
    #set($projectFilter = $contourFilterDao.getSmartFilter(5900))
    $smartFilterService.searchDocs​($projectFilter, 0, 1000, "ASC").getResults()


    ------------------------------
    Florian
    ------------------------------


  • 2.  RE: How to get result items/documents of filter in velocity report

    Posted 30 days ago
    Edited by Decoteau Wilkerson 30 days ago

    Hi Florian,

    Thank you for reaching out! You cannot create a filter within the report itself. However, you can make a filter in Jama showing the results you want and then create a context sensitive report based off of that. 

    Please let me know if you have any questions! 



    ------------------------------
    Decoteau Wilkerson
    Jama Software
    OR
    ------------------------------



  • 3.  RE: How to get result items/documents of filter in velocity report

    Posted 29 days ago
    Hi Decoteau,

    thank you for your response.

    Just to clarify: I do not want to create a filter in the report, I would like to get the result of an existing filter via the filter id.
    (see screenshot in previous post of filter "Testfilter123" with "id": 5900)
    Basically I want to get the same data like the REST API call:

    /filters/{filterId}/results


    So there is no way to get that inside a report?

    ------------------------------
    Florian Giller
    Panasonic Industrial Devices Europe GmbH
    Lüneburg
    ------------------------------



  • 4.  RE: How to get result items/documents of filter in velocity report

    Posted 29 days ago
    Hi Florian,

    Thank you for clarifying! The best way to show the results of your report is to run the report from the filter and use the documentList object to get the items.

    Please note, I am sharing a list of our available Velocity methods that can be used for reports. There is a getFilter method shown in the Velocity API section. However, that call (getFilter) will not show the results of the filter. It will just show the Filter as an object.

    Next, there is a call getFilter:getDocumentList (FilterDTO filter, int start, int count, java.lang.String orderBy) that you could try as it may may display your filter results in pages and not by item (though that may not be what you're looking for.)

    This request would make an excellent Idea in our Ideation module, you can read about our customer innovation process here: https://community.jamasoftware.com/ideation-home/product-idea-process

    Please let me know if you have any questions.

    ------------------------------
    Decoteau Wilkerson
    Jama Software
    OR
    ------------------------------



  • 5.  RE: How to get result items/documents of filter in velocity report

    Posted 16 days ago
    Hi Decoteau,

    sadly, we couldn't get it to work.
    It is quite inconvenient to debug the velocity reports.

    Now we have developed our own solution (in Python) extending the REST API client based on the py-jama-rest-client package.
    It's not much faster than the velocity reports, but we can schedule it to run automatically at night.

    Thank you for your support!

    ------------------------------
    Florian Giller
    Panasonic Industrial Devices Europe GmbH
    Lüneburg
    ------------------------------



  • 6.  RE: How to get result items/documents of filter in velocity report

    Posted 16 days ago

    Hi Florian,

    Thank you for the this update. I am happy to hear that you found this solution! It sounds like it will work for your needs and is especially convenient in that it automatically runs each night. 

    Please let me know if I can offer further assistance. 

    Best, 



    ------------------------------
    Decoteau Wilkerson
    Jama Software
    OR
    ------------------------------