How to create relative date parameters for Domain

1

I need to create a relative date parameter in Jaspersoft Studio 6.2.  I am using a domain and not a SQL data source.

I have googled "jaspersoft studio domain relative date" and searched for "domain relative date" in the community wiki.

The "best" results that I have found are listed below.


Unfortunately, all reference a SQL data source.  For example:
<querystring>
    <!--[CDATA[select * from test_table where $X{EQUAL, orderDate, dateRange}]]-->
</querystring>


Below you will find my:

  • parameter:  dateRange
  • queryField: dbo_RPT_OpportunityDeNorm.OpenDate
  • field: dbo_RPT_OpportunityDeNorm.OpenDate


    <parameter name="dateRange" class="net.sf.jasperreports.types.date.TimestampRange">
        <defaultValueExpression><![CDATA[new net.sf.jasperreports.types.date.DateRangeBuilder("WEEK-52").set(java.sql.Timestamp.class).toDateRange()]]></defaultValueExpression>
    </parameter>
    <queryString language="domain">
        <![CDATA[<query>
            <queryFields>
                <queryField id="dbo_RPT_OpportunityPracticeGroup.PracticeGroup_Name"/>
                <queryField id="dbo_RPT_OpportunityDeNorm.OpenDate"/>
                <queryField id="dbo_RPT_OpportunityDeNorm.OpportunityOutcome"/>
            </queryFields>
            <queryFilterString>dbo_RPT_OpportunityDeNorm.StatusLabel == &apos;Closed&apos;</queryFilterString>
        </query>]]>
    </queryString>

    <field name="dbo_RPT_OpportunityDeNorm.OpenDate" class="java.sql.Timestamp">
        <fieldDescription><![CDATA[Open Date]]></fieldDescription>
    </field>


What I don't understand is how to add the following condition:  $X{EQUAL,dbo_RPT_OpportunityDeNorm.OpenDate,dateRange}

Thank you for your assistance.

terry.davis's picture
Joined: Mar 13 2016 - 10:39am
Last seen: 1 year 2 months ago

0 Answers:

No answers yet
Feedback
randomness