Jump to content
  • How to add a custom filter for Search Repository page in Jasperreport Server 7.2.0


    aphalke
    • Features: Repository Version: v7.2 Product: JasperReports® Server

    If you want to get all the reports and some other resources in the search view os jasperserver, you can follow the steps below : 

    In this example we are going to create a filter that will show only Reports & Ad-hoc View in the search view by default : 


    1. Add following Entry into the  <util:map id="proFilterOptionToResourceTypes"> bean, which is defined in applicationContext-search-pro.xml file 

      

         <entry key="resourceTypeFilter-reports-adhoc">
                <list>
                    <value>com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit</value>
                    <value>com.jaspersoft.ji.adhoc.AdhocReportUnit</value>
                    <value>com.jaspersoft.ji.adhoc.AdhocDataView</value>
                </list>
            </entry>


            
    2. Add new bean as below 

            

    <bean class="com.jaspersoft.jasperserver.search.common.Option">
                <property name="id" value="resourceTypeFilter-reports-adhoc"/>
                <property name="labelId" value="SEARCH_TYPE_REPORT_ADHOC"/>
                <property name="roleAccessList" ref="${bean.resourceTypeFilter.All.RoleAccessList}"/>
            </bean>


            
    into the

     <util:list id="resourceTypeFilterOptionsPro">

    defined in applicationContext-search-pro.xml file 

    3. Add the below line

        

    SEARCH_TYPE_REPORT_ADHOC=Reports & Views


     
    in jasperserver_messages.properties file located under WEB-INF/bundles/

    4. As of now, we created a separate filter for reports and views. add the new filter resourceTypeFilter-reports-adhoc into the default filter defination in applicationContext-search.xml as below :

     

    <util:map id="defaultCustomFiltersMap">
            <entry key="accessTypeFilter" value="accessTypeFilter-all"/>
            <entry key="timeFilter" value="timeFilter-anyTime"/>
            <entry key="scheduleFilter" value="scheduleFilter-anySchedule"/>
            <entry key="resourceTypeFilter" value="resourceTypeFilter-reports-adhoc"/>
        </util:map>


        
    Once adding all the details, save the files and restart the server. 

     


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...