CA Service Management

 View Only
Expand all | Collapse all

Open Date Filter in Active Incidents Report

  • 1.  Open Date Filter in Active Incidents Report

    Posted Aug 23, 2018 11:35 AM

    Hi!

    i want to put a open date input control in a copy of Active_Incidents Report on CABI 6.2

    the report is composed of the following

    1. main_jrxml
    2. Active_Incidents_By_Analyst.jrxml
    3. Active_Incidents_By_Analyst_subreport.jrxml
    4. Active_Incidents_By_Category.jrxml
    5. Active_Incidents_By_Category_subreport.jrxml

    (i dont use the subreport of by priority and group)

    I do the following:

    First i select the filter from the repository

     

     

     

    Then i set the parameter on the Main Report and sub-reports as follows:

     

    In the MAIN report

    first i set the parameter:

     

    <parameter name="p_finalstartdate" class="java.sql.Timestamp">

          <parameterDescription><![CDATA[]]></parameterDescription>

     </parameter>

    then i set the variables:

    <variable name="v_finalstartdate" class="java.lang.String" resetType="None">

    <variableExpression><![CDATA["{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalstartdate})+"'}"]]></variableExpression>

    </variable>

     

    and finally i set the parameter in the subreport (by analyst and by category)

    <subreportParameter name="p_finalstartdate">

    <subreportParameterExpression><![CDATA[$V{v_finalstartdate}]]></subreportParameterExpression>

    </subreportParameter>

     

    In the respective subreports (by analyst and by category subreports)

    Before the Query i set

    <parameter name="p_finalstartdate" class="java.sql.Timestamp"/>

     

    Then in the query i set

    and open_date >= $P!{p_finalstartdate}

     

    Save and import..

    The reports run without error message

    But the only subreport that is filter like i want is the graph not the list

    the list not appear in the report, i think that the report filter the list but the dates does not match or something like this.

    i use  <parameter name="p_finalstartdate" class="java.sql.Timestamp"/> and and open_date >= $P!{p_finalstartdate} in the query of the graph and the query of the list, but only the graph are doing what i wanted.

    Why the subreport(LIST) does not respond to the filter and the graph subreport does it?

     

    Please help!



  • 2.  Re: Open Date Filter in Active Incidents Report

    Broadcom Employee
    Posted Aug 27, 2018 09:59 AM

    SteveTroy - any ideas here?



  • 3.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 28, 2018 04:58 PM

    almost 200 views and no idea provided, really?



  • 4.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 28, 2018 07:44 PM

    Can't tell for sure what the problem is based on the description but first thing I would check and see if the date is being passed to the subreport.

     

     

    If you think it being passed to the subreport then in the subreport print the date.  It should look somehting like 



  • 5.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 29, 2018 09:35 AM

    Hi Steve!

    Thanks for the reply.

    Yes, the parameter is being passed 

    But i have compilation errors, my variable is setted like this



  • 6.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 29, 2018 11:54 AM

    Not sure why you are getting compilation errors but your variable needs to be defined as 

     

    "{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalstartdate})+"'}" 

     

    to work.

     



  • 7.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 29, 2018 03:23 PM

    Hi, I changed the variable expression to

     "{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalstartdate})+"'}" 

    The main stay like this

    "By_Analyst" stay like this

    And "By_Category" stay like this

    The report run and the jasperserver show me this message

    In other ootb report (active_request) i can put the input date control and run well, with variable java.Lang.String and parameter Java.sql.Timestamp and this variable expression  "{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalstartdate})+"'}"  but obviously i am doing something wrong in this report and don't know what is



  • 8.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 29, 2018 04:37 PM

    Attach the .jrxml of the subreport that doesn't work and let me take a look



  • 9.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 29, 2018 04:58 PM

    Here is

     

    I have attached the "By_Analyst" and "By_Analyst_subreport" with the main



  • 10.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 29, 2018 05:34 PM

    Change p_finalstartdate to java.lang.String.

     



  • 11.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 30, 2018 10:05 AM

    it send me this message

    I want to retrieve all the tickets that have a open_date >= p_finalstartdate

     

    If, this parameter is a string, i can not will get all the tickets, only the ticket that match with the parameter.



  • 12.  Re: Open Date Filter in Active Incidents Report

    Posted Aug 30, 2018 10:56 AM

    This SQL in my sub report 

     

    select ref_num, open_date from cr
    where active = 1 and open_date >= $P!{p_finalstartdate}
    order by ref_num Desc

     

    works.    

     

    p_finalstartdate is defined as a string in my subreport



  • 13.  Re: Open Date Filter in Active Incidents Report

    Broadcom Employee
    Posted Sep 07, 2018 12:49 PM

    varelafpy 

    Do you require any additional assistance on this topic?

     

    If not, please mark one of the provided responses as correct so that this thread can be closed.