Jump to content
Changes to the Jaspersoft community edition download ×

How to create relative date parameters for Domain


Recommended Posts

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:
    <!--[CDATA[select * from test_table where $X{EQUAL, orderDate, dateRange}]]-->

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>
    <queryString language="domain">
                <queryField id="dbo_RPT_OpportunityPracticeGroup.PracticeGroup_Name"/>
                <queryField id="dbo_RPT_OpportunityDeNorm.OpenDate"/>
                <queryField id="dbo_RPT_OpportunityDeNorm.OpportunityOutcome"/>
            <queryFilterString>dbo_RPT_OpportunityDeNorm.StatusLabel == 'Closed'</queryFilterString>

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

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

Thank you for your assistance.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...