dynamic date parameters is not accepted in query sting

Hi,

i am trying to create a report with synamic date parameters. But when i try to compile the report i am getting a blank report. I am using the query as mentioned below:

<subDataset name="tableDataset" uuid="5d2f62b7-e620-473f-b2ac-7d4157230c69">
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="IT_db"/>
        <parameter name="from_Date" class="java.sql.Date">
            <parameterDescription><![CDATA[]]></parameterDescription>
        </parameter>
        <parameter name="to_Date" class="java.sql.Date"/>
        <queryString language="SQL">
            <![CDATA[select cf.value_string as "Type of call", count(cf.value_string) as "Number of calls" from task t, custom_fields cf  where cf.value_string in ('ENQUIRY', 'BLANK', 'INCIDENT') AND t.task_id = cf.task_id  AND (t.created_timestamp > TO_timestamp($P{from_Date}, 'YYYY-MM-DD hh.mi.ss') AND t.created_timestamp < TO_timestamp($P{to_Date}, 'YYYY-MM-DD hh.mi.ss')) group by value_string]]>
        </queryString>
        <field name="Type of call" class="java.lang.String"/>
        <field name="Number of calls" class="java.math.BigDecimal"/>
        <group name="Type of call">
            <groupExpression><![CDATA[$F{Type of call}]]></groupExpression>
        </group>
    </subDataset>

The report works fine if i use hardcoded values instead of $P{from_Date} and $P{to_Date}.

Can anybody tell where am i going wrong?

vaidehi.thakre's picture
Joined: Mar 3 2015 - 1:27am
Last seen: 7 years 4 months ago

At run time what values are you passing to $P{to_date} and $P{from_date}?

marianol - 7 years 4 months ago

0 Answers:

No answers yet
Feedback
randomness