CA Service Management

Expand all | Collapse all

Open Date Filter in Out of Box Active Request List Report

  • 1.  Open Date Filter in Out of Box Active Request List Report

    Posted Oct 24, 2016 03:52 AM

    Hi Team,

     

    I have set up CABI Jaspersoft r6.2.0. I am using Jasperstudio for customizing the reports. I created a copy of out of box Active Request List report. After that, from Jaspersoft, I added the following input controls in that copied report:

     

     

     

    These controls were started displaying in the Jasperstudio Repository Explorer as shown below:

     

    After this, I updated the source code of the report in Jasperstudio to add the parameters as follows:

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

     

    And finally updated the query to add the condition of the open date of request as follows:

    SELECT
    cr.ref_num,
    cr.id,
    cr.open_date,
    cr.priority_symbol,
    cr.status_symbol,
    cr.summary,
    cr.web_url,
    cr.customer_combo_name,
    cr.assignee_combo_name,
    cr.assignee_combo_name as ANALYST
    FROM
    cr
    WHERE cr.type = 'R' and cr.active = 1 and cr.open_date >= $P{p_finalstartdate} and cr.open_date <= $P{p_finalenddate}
    ORDER by ANALYST, cr.id DESC

     

    The report is not giving any errors during execution, but it is not displaying any results after providing the start date and end date in the following prompt:

     

    Kindly provide solution for this.

     

    Thanks & Regards,

    Balram Singh Deswal



  • 2.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 25, 2016 04:34 AM

    Hi Team,

     

    Kindly provide solution for this thread.

     

    Regards,

    Balram



  • 3.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Oct 25, 2016 05:58 AM

    Hi,

     

    You will notice where you copied the "Active Request List report" from that there was also a main.jrmx report in the same report unit folder and the "Active Request List report" was a sub report on the main.jrmx report. The main report converts the parameters used with variables and the variables populates the subreport parameters which can then be used in the where clause because it is a string and not a sql.timestamp.

     

    Hope this answers your question.

     

    Regards,

    Charl

     

     



  • 4.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 25, 2016 06:27 AM

    Hi Charl,

     

    Thank you so much for your response.

     

    I have tried updating the data type of the following parameters:

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

     

    to

     

    <parameter name="p_finalstartdate" class="java.lang.String"/>
    <parameter name="p_finalenddate" class="java.lang.String"/>

     

    Still it is not giving any output after providing the parameters of start and end date.

     

    Kindly suggest.

     

    Regards,

    Balram



  • 5.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Oct 25, 2016 06:59 AM

    Hi Balram,

     

    You need to 2 reports 1 main, 1 subreport.

     

    [Main report parameters]

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

     

    [Main Report 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>
    <variable name="v_finalenddate" class="java.lang.String"  resetType="None">

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

    </variable>

     

    [Subreport parameters]

    <parameter name="p_finalstartdate" class="String"/>
    <parameter name="p_finalenddate" class="String"/>

     

    Create the main report and link the subreport and click on the subreport while on the main report and click edit parameters and link main report variables with the subreport parameters.

     

    v_finalstartdate - > p_finalstartdate

    v_finalenddate - > p_finalenddate

     

    Hope this gives you more info and resolves your issue.

     

    Regards,
    Charl

     



  • 6.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 26, 2016 01:50 AM

    Hi Charl,

     

    Thanks for the detailed explanation. To be very frank, I am completely new in creating customized Jaspersoft reports for SDM.

    In the reports folder, I created a new folder in which I pasted the out of box Active Request List report. In that report, there is only one main_jrxml.xml file. As you said, I need to create a subreport also. By that, you mean to say I need to create another jrxml file in that report? In that subreport, there will be only two parameters defined?? How I would link the main report variables with subreport parameters?

     

    Kindly provide little bit more insight.

     

    Regards,

    Balram



  • 7.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 26, 2016 01:55 AM

    I tried creating a new jrxml file in that report. But it is not opening in the report editor section. Giving error on opening.



  • 8.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Oct 26, 2016 04:02 AM

    Hi Balram,

     

    Create the main report, File -> New Report, select report template, update the filename from "Blank_A4_Landscape_3.jrxml" to "main.jrxml", click finish

    Once the new main report is open in the designer drag and drop the "Subreport" Element from the Basic Elements List into the Detail Band.

     

    The Subreport wizard should have opened, select "Create a new Report", select report template, update the filename from "Blank_A4_Landscape_3.jrxml" to "sdm.jrxml", click finish

    Both reports should be open in your Jaspersoft Studio ( main.jrxml & sdm.jrxml )


    [Create main.jrxml parameters]

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


    [Create main.jrxml 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>
    <variable name="v_finalenddate" class="java.lang.String" resetType="None">
    <variableExpression><![CDATA["{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalenddate})+"'}"]]></variableExpression>
    </variable>


    [Update main.jrxml report query]

    select distinct 1 + 2 as one
    from cr

     

    [Create sdm.jrxml parameters]

    <parameter name="p_finalstartdate" class="String"/>
    <parameter name="p_finalenddate" class="String"/>


    On the main.jrxml select the subreport in the Detail Band, click on the properties tab and then click on Subreport and edit parameters (here you will link the main.jrxml variables with sdm.jrxml parameters)


    [Update sdm.jrxml report query]

    SELECT
    cr.ref_num,
    cr.id,
    cr.open_date,
    cr.priority_symbol,
    cr.status_symbol,
    cr.summary,
    cr.web_url,
    cr.customer_combo_name,
    cr.assignee_combo_name,
    cr.assignee_combo_name as ANALYST
    FROM
    cr
    WHERE cr.type = 'R' and cr.active = 1 and cr.open_date >= $P{p_finalstartdate} and cr.open_date <= $P{p_finalenddate}
    ORDER by ANALYST, cr.id DESC

     

    Let you know should you not come right then I will create a example for you.

     

    Regards,

    Charl



  • 9.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 26, 2016 06:16 AM

    Hi Charl,

     

    The subreport sdm.jrxml is not appearing in the same report unit folder as the main.jrxml file.

     

     

    Also not sure how to map the parameters of main.jrxml with sdm.jrxml

     

    Kindly elaborate with the help of an example (if possible, attach screenshot for reference).

     

    Thanks & Regards,

    Balram



  • 10.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Oct 26, 2016 09:09 AM

    Hi Balram,

     

    You need to start from fresh, your main report is actually the sdm report in my example.

     

    First create the main report from scratch then on the main report you create the subreport and then when you publish both reports they will be published to the same report unit folder.

     

    For the parameters between main and sdm click on the "Edit Parameters" button.

     

     

    Then you will get to this screen for you to map the main variables to sdm parameters

     

     

    Regards,
    Charl



  • 11.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 27, 2016 01:15 AM

    Hi Charl,

     

    I followed all the steps you mentioned in the previous comments. When I published the main.jrxml (sdm.jrxml published along with it) on the jasperserver and run the report from CABI Jaspersoft, it is giving the following error:

     

     

    I published it twice in different report units (created fresh). One without any data source and other with sdm_ds datasource (out of box datasource provided with CABI Jaspersoft). The error is same as provided above.

     

    Here are the contents of main.jrxml and sdm.jrxml for your reference:

     

    main.jrxml

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
    <!-- 2016-10-27T10:17:14 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="main" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="54cebf94-96ca-4e7d-9733-ff9761dc7f66">
    <property name="ireport.jasperserver.url" value="http://192.168.1.211:8090/jasperserver-pro/"/>
    <property name="ireport.jasperserver.user" value="servicedesk|servicemanagement"/>
    <property name="ireport.jasperserver.report.resource" value="/capability/reports/Helpdesk_Reports_2/Community_Report_without_Data_Source_files/main_jrxml"/>
    <property name="ireport.jasperserver.reportUnit" value="/capability/reports/Helpdesk_Reports_2/Community_Report_without_Data_Source"/>
    <parameter name="p_finalstartdate" class="java.sql.Timestamp"/>
    <parameter name="p_finalenddate" class="java.sql.Timestamp"/>
    <queryString>
    <![CDATA[select distinct 1 + 2 as one
    from cr]]>
    </queryString>
    <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>
    <variable name="v_finalenddate" class="java.lang.String" resetType="None">
    <variableExpression><![CDATA["{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalenddate})+"'}"]]></variableExpression>
    </variable>
    <background>
    <band splitType="Stretch"/>
    </background>
    <title>
    <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
    <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
    <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
    <band height="257" splitType="Stretch">
    <subreport>
    <reportElement x="276" y="57" width="200" height="200" uuid="b06ab9eb-5abf-4381-a01d-3d0468903b00"/>
    <subreportParameter name="v_finalstartdate">
    <subreportParameterExpression><![CDATA[p_finalstartdate]]></subreportParameterExpression>
    </subreportParameter>
    <subreportParameter name="v_finalenddate">
    <subreportParameterExpression><![CDATA[p_finalenddate]]></subreportParameterExpression>
    </subreportParameter>
    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
    <subreportExpression><![CDATA["sdm.jasper"]]></subreportExpression>
    </subreport>
    </band>
    </detail>
    <columnFooter>
    <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
    <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
    <band height="42" splitType="Stretch"/>
    </summary>
    </jasperReport>

     

     

    sdm.jrxml

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
    <!-- 2016-10-27T10:02:36 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="sdm" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="538a49df-c6fa-4b04-9480-8f2f08bf7764">
    <parameter name="p_finalstartdate" class="String"/>
    <parameter name="p_finalenddate" class="String"/>
    <queryString>
    <![CDATA[SELECT
    cr.ref_num,
    cr.id,
    cr.open_date,
    cr.priority_symbol,
    cr.status_symbol,
    cr.summary,
    cr.web_url,
    cr.customer_combo_name,
    cr.assignee_combo_name,
    cr.assignee_combo_name as ANALYST
    FROM
    cr
    WHERE cr.type = 'R' and cr.active = 1 and cr.open_date >= $P{p_finalstartdate} and cr.open_date <= $P{p_finalenddate}
    ORDER by ANALYST, cr.id DESC]]>
    </queryString>
    <background>
    <band splitType="Stretch"/>
    </background>
    <title>
    <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
    <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
    <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
    <band height="125" splitType="Stretch"/>
    </detail>
    <columnFooter>
    <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
    <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
    <band height="42" splitType="Stretch"/>
    </summary>
    </jasperReport>

     

    Kindly suggest your valuable inputs on this.

     

    Thanks & Regards,

    Balram



  • 12.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 27, 2016 01:58 AM

    Hi Charl,

     

    I am able to resolve this issue by replacing

    <subreportParameterExpression><![CDATA[p_finalstartdate]]></subreportParameterExpression>

    with

    <subreportParameterExpression><![CDATA[$P{p_finalstartdate}]]></subreportParameterExpression>

     

    and same for p_finalenddate in main.jrxml.

     

    After this, when I published the reports with sdm_ds datasource, it is giving the following error after providing the inputs for start and end date:

     

    When I changed the data type of p_finalstartdate and p_finalenddate from String to java.sql.Timestamp, it is not giving any error but not generating any output either. It is giving a blank screen.

     

    Kindly suggest.

     

    Thanks & Regards,

    Balram

     



  • 13.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 27, 2016 02:07 AM

    Even by changing class="String" to class="java.lang.String", the above mentioned error of "Parameter type not supported" is resolved. But not giving any output after providing the prompt values.



  • 14.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Oct 27, 2016 03:40 AM

    Hi Balram,

     

    Change the subreport parameter values around. The name should be the subreport parameter and the expression should be the variable name from the main report.

     



  • 15.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Oct 27, 2016 07:11 AM

    Hi Charl,

     

    Even after changing subreport parameter values, the report is not displaying output after providing the open & start date.

    The contents of main.jrxml & sdm.jrxml is as follows:

     

    main.jrxml

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
    <!-- 2016-10-27T16:39:01 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="main" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="54cebf94-96ca-4e7d-9733-ff9761dc7f66">
    <property name="ireport.jasperserver.url" value="http://192.168.1.211:8090/jasperserver-pro/"/>
    <property name="ireport.jasperserver.user" value="servicedesk|servicemanagement"/>
    <property name="ireport.jasperserver.report.resource" value="/capability/reports/Helpdesk_Reports/Community_Solution_WIP_files/main_jrxml"/>
    <property name="ireport.jasperserver.reportUnit" value="/capability/reports/Helpdesk_Reports/Community_Solution_WIP"/>
    <parameter name="p_finalstartdate" class="java.sql.Timestamp"/>
    <parameter name="p_finalenddate" class="java.sql.Timestamp"/>
    <queryString>
    <![CDATA[select distinct 1 + 2 as one
    from cr]]>
    </queryString>
    <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>
    <variable name="v_finalenddate" class="java.lang.String" resetType="None">
    <variableExpression><![CDATA["{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalenddate})+"'}"]]></variableExpression>
    </variable>
    <background>
    <band splitType="Stretch"/>
    </background>
    <title>
    <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
    <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
    <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
    <band height="257" splitType="Stretch">
    <subreport>
    <reportElement x="276" y="57" width="200" height="200" uuid="b06ab9eb-5abf-4381-a01d-3d0468903b00"/>
    <subreportParameter name="p_finalstartdate">
    <subreportParameterExpression><![CDATA[$V{v_finalstartdate}]]></subreportParameterExpression>
    </subreportParameter>
    <subreportParameter name="p_finalenddate">
    <subreportParameterExpression><![CDATA[$V{v_finalenddate}]]></subreportParameterExpression>
    </subreportParameter>
    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
    <subreportExpression><![CDATA["repo:sdm.jrxml"]]></subreportExpression>
    </subreport>
    </band>
    </detail>
    <columnFooter>
    <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
    <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
    <band height="42" splitType="Stretch"/>
    </summary>
    </jasperReport>

     

    sdm.jrxml

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
    <!-- 2016-10-27T16:40:17 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="sdm" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="538a49df-c6fa-4b04-9480-8f2f08bf7764">
    <property name="ireport.jasperserver.url" value="http://192.168.1.211:8090/jasperserver-pro/"/>
    <property name="ireport.jasperserver.user" value="servicedesk|servicemanagement"/>
    <property name="ireport.jasperserver.report.resource" value="/capability/reports/Helpdesk_Reports/Community_Solution_WIP_files/sdm.jrxml"/>
    <property name="ireport.jasperserver.reportUnit" value="/capability/reports/Helpdesk_Reports/Community_Solution_WIP"/>
    <parameter name="p_finalstartdate" class="java.lang.String"/>
    <parameter name="p_finalenddate" class="java.lang.String"/>
    <queryString>
    <![CDATA[SELECT
    cr.ref_num,
    cr.id,
    cr.open_date,
    cr.priority_symbol,
    cr.status_symbol,
    cr.summary,
    cr.web_url,
    cr.customer_combo_name,
    cr.assignee_combo_name,
    cr.assignee_combo_name as ANALYST
    FROM
    cr
    WHERE cr.type = 'R' and cr.active = 1 and cr.open_date >= $P{p_finalstartdate} and cr.open_date <= $P{p_finalenddate}
    ORDER by ANALYST, cr.id DESC]]>
    </queryString>
    <background>
    <band splitType="Stretch"/>
    </background>
    <title>
    <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
    <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
    <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
    <band height="125" splitType="Stretch"/>
    </detail>
    <columnFooter>
    <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
    <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
    <band height="42" splitType="Stretch"/>
    </summary>
    </jasperReport>

     

    Kindly suggest. I am also looking for the alternatives.

     

    Regards,

    Balram



  • 16.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Oct 27, 2016 09:35 AM

    Hi Balram,

     

    In your sdm.jrxml report are your returning any field names from your query? in this example I returned the ref_num and after this was created drag en drop it from your Outline tab under Fields on your sdm report detail section and see if you can generate anything on the report.

     



  • 17.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Nov 02, 2016 06:54 AM

    Hi Charl,

     

    Where does this Dataset and Query dialog appears?

    Kindly suggest.

     

    Thanks & Regards,

    Balram



  • 18.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Nov 03, 2016 03:17 AM

    Hi Balram,

     

    On the sdm report click on the "DataSet and Query editor dialog" button.

     



  • 19.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Nov 29, 2016 02:08 AM

    Hi Charl,

     

    Sorry for the delayed response as I was on leave.

    Using the dataset and query dialog, I added the field ref_num as shown below:

     

    Added this field in the sdm.jrxml as shown below:

     

    After publishing, the prompt for open date is taking input in String format as shown below:

     

    After providing the inputs, it is not producing any data. Even after changing the datatype from String to timestamp, it is taking input in date time format, but doesn't provide any data in output.

     

    Here are the contents of main.jrxml and sdm.jrxml for your reference:

     

    main.jrxml

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
    <!-- 2016-11-29T12:22:03 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="main" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="aec6890c-0958-46f0-9b8a-7244a5b11c5e">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <property name="ireport.jasperserver.url" value="http://192.168.1.211:8090/jasperserver-pro/"/>
    <property name="ireport.jasperserver.user" value="servicedesk|servicemanagement"/>
    <property name="ireport.jasperserver.report.resource" value="/capability/reports/CA_Service_Desk/GIC_Helpdesk_Reports/Demo_Prompt_Report_for_Request_files/main_jrxml"/>
    <property name="ireport.jasperserver.reportUnit" value="/capability/reports/CA_Service_Desk/GIC_Helpdesk_Reports/Demo_Prompt_Report_for_Request"/>
    <parameter name="p_finalstartdate" class="java.sql.Timestamp"/>
    <parameter name="p_finalenddate" class="java.sql.Timestamp"/>
    <queryString>
    <![CDATA[select distinct 1 + 2 as one
    from cr]]>
    </queryString>
    <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>
    <variable name="v_finalenddate" class="java.lang.String" resetType="None">
    <variableExpression><![CDATA["{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalenddate})+"'}"]]></variableExpression>
    </variable>
    <background>
    <band splitType="Stretch"/>
    </background>
    <title>
    <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
    <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
    <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
    <band height="285" splitType="Stretch">
    <subreport>
    <reportElement x="390" y="85" width="200" height="200" uuid="3fe5d725-b214-47cf-9acf-9fb64bfde96c"/>
    <subreportParameter name="p_finalstartdate">
    <subreportParameterExpression><![CDATA[$V{v_finalstartdate}]]></subreportParameterExpression>
    </subreportParameter>
    <subreportParameter name="p_finalenddate">
    <subreportParameterExpression><![CDATA[$V{v_finalenddate}]]></subreportParameterExpression>
    </subreportParameter>
    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
    <subreportExpression><![CDATA["sdm.jasper"]]></subreportExpression>
    </subreport>
    </band>
    </detail>
    <columnFooter>
    <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
    <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
    <band height="42" splitType="Stretch"/>
    </summary>
    </jasperReport>

     

     

    sdm.jrxml

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
    <!-- 2016-11-29T12:37:16 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="sdm" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="2ab9e28e-71aa-42ff-a421-bd5a93a20f57">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <property name="ireport.jasperserver.url" value="http://192.168.1.211:8090/jasperserver-pro/"/>
    <property name="ireport.jasperserver.user" value="servicedesk|servicemanagement"/>
    <property name="ireport.jasperserver.report.resource" value="/capability/reports/CA_Service_Desk/GIC_Helpdesk_Reports/Demo_Prompt_Report_for_Request_files/main_jrxml"/>
    <property name="ireport.jasperserver.reportUnit" value="/capability/reports/CA_Service_Desk/GIC_Helpdesk_Reports/Demo_Prompt_Report_for_Request"/>
    <parameter name="p_finalstartdate" class="java.lang.String"/>
    <parameter name="p_finalenddate" class="java.lang.String"/>
    <queryString>
    <![CDATA[SELECT
    cr.ref_num,
    cr.id,
    cr.open_date,
    cr.priority_symbol,
    cr.status_symbol,
    cr.summary,
    cr.web_url,
    cr.customer_combo_name,
    cr.assignee_combo_name,
    cr.assignee_combo_name as ANALYST
    FROM
    cr
    WHERE cr.type = 'R' and cr.active = 1 and cr.open_date >= $P{p_finalstartdate} and cr.open_date <= $P{p_finalenddate}
    ORDER by ANALYST, cr.id DESC]]>
    </queryString>
    <field name="ref_num" class="java.lang.String"/>
    <background>
    <band splitType="Stretch"/>
    </background>
    <title>
    <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
    <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
    <band height="61" splitType="Stretch">
    <staticText>
    <reportElement x="212" y="0" width="100" height="30" uuid="c44ab265-2076-4dea-852c-ba0b7011d998"/>
    <text><![CDATA[ref_num]]></text>
    </staticText>
    </band>
    </columnHeader>
    <detail>
    <band height="125" splitType="Stretch">
    <textField>
    <reportElement x="212" y="45" width="100" height="30" uuid="bc25140b-efa8-4112-9aa6-252dbb6043dd"/>
    <textFieldExpression><![CDATA[$F{ref_num}]]></textFieldExpression>
    </textField>
    </band>
    </detail>
    <columnFooter>
    <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
    <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
    <band height="42" splitType="Stretch"/>
    </summary>
    </jasperReport>

     

     

    Kindly provide your inputs on this.

     

    Thanks & Regards,

    Balram Singh Deswal



  • 20.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Nov 30, 2016 02:20 AM

    Hi Charl,

     

    Referring to the above reply, if I am removing the condition  (and cr.open_date >= $P{p_finalstartdate} and cr.open_date <= $P{p_finalenddate}) from the query section in sdm.jrxml file, it is producing the report. But on keeping this condition, the report is coming empty.

     

    Also the format in which the report is being generating is dependent on how I publish them from jasperstudio. If I publish main.jrxml in the end, the report gets generated in unconventional format. First two pages are coming blank and then report is showing from third page. Every record is showing on a single page.

     

    If I publish sdm.jrxml in the end (with ignoring p_finalstartdate and p_finalenddate parameters), the parameters are accepted in date/time format and report gets generated fine (but without condition of open date). If I publish sdm.jrxml in the end (with overwriting p_finalstartdate and p_finalenddate parameters), the parameters are accepted in String format and report gets generated fine (but without condition of open date).

     

    Is there any issue with the format of date?

     

    Kindly provide the solution so that it will start giving output as per the open date filter also.

     

    Thanks & Regards,

    Balram



  • 21.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Nov 30, 2016 06:03 AM

    Hi Balram,

     

    The reports works on my side. When you execute the report verify if you have any error messages in the SDM stdlog. 

    Also try to Compile the report when you are done making changes.

     

    Please find my reports attached and the compiled files for each.

     

    Regards,

    Charl

    Attachment(s)

    zip
    main.jrxml.zip   981 B 1 version
    zip
    main.jasper.zip   5 KB 1 version
    zip
    sdm.jasper.zip   6 KB 1 version
    zip
    sdm.jrxml.zip   914 B 1 version


  • 22.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Nov 30, 2016 06:34 AM

    Hi Charl,

     

    Thanks for your response.

     

    My report is not giving any error during compilation but not producing any output either. To make sure the value of the date parameters and variables that are being passed to the sdm.jrxml file, I put p_finalstartdate, p_finalenddate, v_finalstartdate, v_finalenddate in the title of main.jrxml file.

    Following values are shown after compilation:

     

    Upper row is parameters and lower is variables. But the format in which the open date values come in report when executed without condition is as follows:

     

     

    Kindly suggest if something is wrong in my approach. Otherwise request you to copy paste the contents of main.jrxml and sdm.jrxml from your end so that I can test that here.

     

    Thanks again for helping me in this issue.

     

    Regards,

    Balram



  • 23.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Nov 30, 2016 07:54 AM

    Hi Balram,

     

    The report date format and the ticket date format will be a different format. You can verify if something is wrong with the query when the query was converted on the SDM side and if so the error will be written to the CA SDM stdlog.

     

    Please find attached the contents of my main.jrxml and sdm.jrxml

     

    ---------------

    [main.jrxml]

    ---------------

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
    <!-- 2016-11-30T12:47:51 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="main" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ad831126-215d-4edf-bcae-d651d99a1522">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="sdm_ds"/>
    <parameter name="p_finalstartdate" class="java.sql.Timestamp"/>
    <parameter name="p_finalenddate" class="java.sql.Timestamp"/>
    <queryString>
    <![CDATA[select distinct 1 + 2 as one
    from cr]]>
    </queryString>
    <field name="one" class="java.lang.Integer"/>
    <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>
    <variable name="v_finalenddate" class="java.lang.String" resetType="None">
    <variableExpression><![CDATA["{ts'"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format($P{p_finalenddate})+"'}"]]></variableExpression>
    </variable>
    <background>
    <band splitType="Stretch"/>
    </background>
    <detail>
    <band height="54" splitType="Stretch">
    <subreport>
    <reportElement x="0" y="0" width="800" height="50" uuid="b8282084-4035-41f2-85bd-be56e068338a"/>
    <subreportParameter name="p_finalstartdate">
    <subreportParameterExpression><![CDATA[$V{v_finalstartdate}]]></subreportParameterExpression>
    </subreportParameter>
    <subreportParameter name="p_finalenddate">
    <subreportParameterExpression><![CDATA[$V{v_finalenddate}]]></subreportParameterExpression>
    </subreportParameter>
    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
    <subreportExpression><![CDATA["sdm.jasper"]]></subreportExpression>
    </subreport>
    </band>
    </detail>
    </jasperReport>

     

    ---------------

    [sdm.jrxml]

    ---------------

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.3.0 -->
    <!-- 2016-11-30T12:47:07 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="sdm" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="cee6cf19-de73-4cec-848f-21785c3354a5">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="sdm_ds"/>
    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
    <parameter name="p_finalstartdate" class="java.lang.String"/>
    <parameter name="p_finalenddate" class="java.lang.String"/>
    <queryString>
    <![CDATA[SELECT
    ref_num
    FROM
    cr
    WHERE type = 'R' and active = 1 and open_date >= $P!{p_finalstartdate} and open_date <= $P!{p_finalenddate}]]>
    </queryString>
    <field name="ref_num" class="java.lang.String"/>
    <background>
    <band splitType="Stretch"/>
    </background>
    <columnHeader>
    <band height="33" splitType="Stretch">
    <staticText>
    <reportElement x="0" y="0" width="100" height="30" uuid="6547d9ba-900c-4473-b523-8e97ca7d57b1"/>
    <text><![CDATA[ref_num]]></text>
    </staticText>
    </band>
    </columnHeader>
    <detail>
    <band height="34" splitType="Stretch">
    <textField>
    <reportElement x="0" y="0" width="100" height="30" uuid="524a7367-2eb1-4f49-894a-9506ca86fb83"/>
    <textFieldExpression><![CDATA[$F{ref_num}]]></textFieldExpression>
    </textField>
    </band>
    </detail>
    </jasperReport>

    ---------------

    Regards,

    Charl



  • 24.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Dec 01, 2016 12:55 AM

    Hi Charl,

     

    In your main & sdm.jrxml file you are using the value of defaultdataadapter as sdm_ds:

    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="sdm_ds"/>

     

    When I create the new jasper report, it provides the option of Sample DB and One Empty Record only. My files has the following code:

    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>

     

    Although during publishing on Jasperserver, I use the datasource sdm_ds as shown below:

     

    Do I need to create the data adapter sdm_ds also? If yes, kindly share the steps to create that. There are lot of options when we go for creation of data adapter.

     

    Apart from this, I was not returning the field "one" in main.jrxml. Now I did that. May be it is now the issue with the data adapter configuration.

     

    Thanks & Regards,

    Balram Singh Deswal



  • 25.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Dec 01, 2016 01:44 AM

    Hi Charl,

     

    In the query of sdm file, I noticed you used open_date >= $P!{p_finalstartdate} while I was using open_date >= $P{p_finalstartdate}.

     

    When I used the updated query, the report give error during query run. Following is my query which is generating (converted to sql format):

    SELECT ref_num, id, open_date, priority_symbol, status_symbol, summary, customer_combo_name, assignee_combo_name FROM call_req WHERE type = 'R' and active = 1 and open_date >= 2016-07-24T00:00:01 and open_date <= 2016-07-26T01:00:00 ORDER by id DESC

     

    It is giving the following error:

    Msg 102, Level 15, State 1, Line 1
    Incorrect syntax near '00'.



  • 26.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Dec 02, 2016 02:49 AM

    Hi Balram,

     

    Thanks for your feedback,here is a link for creating the sdm_ds connection.

     

    Jasper Studio - Create Data Adapter for SDM 

     

    Let me know should you still have issue after the connection was created, also try to compile the report once you made the final changes.

     

    Regards,

    Charl



  • 27.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Dec 02, 2016 04:39 AM

    Hi Charl,

     

    Currently I don't have access to my environment. I guess the issue will get resolved now after creating this data adapter and implementing the changes that I found earlier.

     

    I will let you know if the issue still persist as soon as I will get access.

     

    Many thanks to you for helping me resolving this issue.

     

    Regards,

    Balram Singh Deswal



  • 28.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Dec 04, 2016 11:00 PM

    Hi Charl,

     

    Now the output is coming as expected.

    Thanks a lot for your immense support.

     

    Regards,

    Balram



  • 29.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Dec 07, 2016 01:35 AM

    Hi Balram,

     

    Great news to hear that your report is generating data now!

     

    Kind Regards,

    Charl



  • 30.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Dec 07, 2016 01:58 AM

    Ya...it took lot of time. The main thing that was missing was the configuration of sdm_ds data adapter in Jasperstudio. I thought it was not needed as I was selecting that data source during publish to jasper server and the report without open date filter was producing data as well.

     

    Now I am working on look and feel of the report to make it more presentable. For the open date prompt, it is showing p_finalstartdate and p_finalenddate. I want to show a meaningful sentence in frontend like "Enter Start Date". Is it possible to take this as parameter (as it contains space in between)? If no, what can be the alternative way?

     

    Regards,

    Balram 



  • 31.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Dec 07, 2016 03:39 AM

    Hi Balram,

     

    You can add a ResourceBundle to the report which will translate the unfriendly names to a more friendly names using properties.

     

    Click on File, New, Other and the search filter type resource and select the ResourceBundle then you can link the ResourceBundle to both reports. Think this only works when you publish the report and make sure on the Jaspersoft web interface that this resource is linked to the reports after it was published.

     

     

     

     

    Regards,

    Charl



  • 32.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Dec 07, 2016 05:12 AM

    Hi Charl,

     

    I have added the resource bundle as you suggested and added the friendly names to the two properties as shown below:

     

    This file is also showing in the hierarchy:

     

    But how to link it with sdm & main file as suggested by you. Here is that screenshot for your reference:

    How this dialog box is opened? In this screenshot you have provided sdm in Report name, do we need to add main file also?

     

    Kindly suggest.

     

    Thanks & Regards,

    Balram



  • 33.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Dec 07, 2016 05:45 AM

    Hi Balram,

     

    It is on the report properties tab.

     



  • 34.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Dec 12, 2016 03:48 AM

    Hi Charl,

     

    I was trying to add the ResourceBundle to both main.jrxml and sdm.jrxml and after publishing it is also reflecting in the Controls & Resources tab in Jaspersoft. Still the prompt is showing p_finalstartdate and p_finalenddate during report execution.

     

    Here are the screenshots for your reference.

     

    Application Resources Parameters:

     

     

    main & sdm.jrxml properties:

     

     

     

    Files in the report folder in jasperstudio:

     

    Controls & Resources tab in Jaspersoft showing the ResourceBundle:

     

    Is it working at your end?

     

    Kindly suggest if I missed anything.

     

    Thanks & Regards,

    Balram



  • 35.  Re: Open Date Filter in Out of Box Active Request List Report

    Posted Nov 24, 2016 08:06 AM

    Hello;

     

    did you successfully managed creating the Date range for that report?

     

    if yes, would you kindly share this with us because we have the same interest?



  • 36.  Re: Open Date Filter in Out of Box Active Request List Report

    Broadcom Employee
    Posted Dec 07, 2016 03:44 AM

    Hi m.fahd,

     

    Think you should be able to create your date range requirement with the detail provided.

     

    Regards,
    Charl