Incompatible java.lang.String value assigned to parameter importDate

View: New views
1 Messages — Rating Filter:   Alert me  

Incompatible java.lang.String value assigned to parameter importDate

by gstephens :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm a new ireport user trying to pass a date as a parameter receiving this Incompatible java.lang.String error from a groovy .gsp page

Here's the .gsp fragment where importDate is a groovy Date:

    <g:jasperReport jasper="reportSec3" format="HTML" name="Securities by Class">
      <input type="hidden" name="importDate" value="${holdingImportDateInstance.importDate}"/>
    </g:jasperReport>

and the jrxml

<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="Sec3" language="groovy" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
        <parameter name="importDate" class="java.util.Date">
                <defaultValueExpression><![CDATA[]]></defaultValueExpression>
        </parameter>

        <queryString>
                <![CDATA[SELECT
     holding.`symbol_id` AS holding_symbol_id,
     holding.`market_value` AS holding_market_value,
     security.`asset_class` AS security_asset_class,
     security.`symbol` AS security_symbol,
     holding_import_date.`import_date` AS holding_import_date_import_date,
     security.`name` AS security_name,
     holding.`date_id` AS holding_date_id,
     holding_import_date.`id` AS holding_import_date_id
FROM
     `security` security INNER JOIN `holding` holding ON security.`id` = holding.`symbol_id`
     INNER JOIN `holding_import_date` holding_import_date ON holding.`date_id` = holding_import_date.`id`
WHERE
     holding_import_date.`import_date` = $P{importDate}