Hi,

I have the following query for the postgresql database:


Code:
--------------------

<queryString><![CDATA[SELECT
evt_src_mgr_rpt_v."evt_src_mgr_name" AS esm_name,
evt_src_collector_rpt_v."evt_src_collector_name" AS collector_name,
evt_src_grp_rpt_v."evt_src_grp_name" AS grp_name,
evt_src_grp_rpt_v."state_ind" AS state_ind,
evt_src_rpt_v."evt_src_name" AS src_name,
evt_src_rpt_v."date_modified" AS date_modified,
evt_src_rpt_v."date_created" AS date_created,
CASE WHEN $P{mysortfield} = 'evt_src_mgr_name' THEN evt_src_mgr_name
WHEN $P{mysortfield} = 'evt_src_collector_name' THEN evt_src_collector_name
WHEN $P{mysortfield} = 'evt_src_grp_name' THEN evt_src_grp_name
ELSE evt_src_name END as sort
FROM
"evt_src_mgr_rpt_v" evt_src_mgr_rpt_v
LEFT JOIN
"evt_src_collector_rpt_v" evt_src_collector_rpt_v
ON EVT_SRC_MGR_RPT_V."evt_src_mgr_id" = evt_src_collector_rpt_v."evt_src_mgr_id"
LEFT JOIN
"evt_src_grp_rpt_v" evt_src_grp_rpt_v
ON evt_src_collector_rpt_v."evt_src_collector_id" = evt_src_grp_rpt_v."evt_src_collector_id"
LEFT JOIN
"evt_src_rpt_v" evt_src_rpt_v
ON evt_src_grp_rpt_v."evt_src_grp_id" = evt_src_rpt_v."evt_src_grp_id"
LEFT JOIN
"evt_src_offset_rpt_v" evt_src_offset_rpt_v
ON evt_src_rpt_v."evt_src_id" = evt_src_offset_rpt_v."evt_src_id"
WHERE
$P!{mysortfield} LIKE '$P!{searchvalue}' || '%']]></queryString>

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


That is I try to select only the records where the field which is
selected by user as report parameter ($P{mysortfield}) contains data
starting with the text entered by user as a report parameter
($P{searchvalue}).

When I try to run the report in iReport with active connection to the
database the report is generated as expected.
But when I try to run the report from Sentinel Log Manager I get the
following error: "java.lang.String cannot be cast to
net.sf.jasperreports.engine.JRValueParameter".

After several detailed debug sessions I finally came into a conclusion
that this error is related to the use of parameter values (
$P!{mysortfield} and $P!{searchvalue} ).

I even tried using the following WHERE clause (which emulates the
queries as used in standart reports (especially at VendorProduct related
SQL queries ) with no success:


Code:
--------------------

WHERE
($P{mysortfield} = 'evt_src_mgr_name' AND evt_src_mgr_name LIKE ($P{searchvalue} || '%')) OR
($P{mysortfield} = 'evt_src_collector_name' AND evt_src_collector_name LIKE ($P{searchvalue} || '%')) OR
($P{mysortfield} = 'evt_src_grp_name' AND evt_src_grp_name LIKE ($P{searchvalue} || '%')) OR
($P{mysortfield} = 'evt_src_name' AND evt_src_name LIKE ($P{searchvalue} || '%'))

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


Any suggestions?


--
hkalyoncu
------------------------------------------------------------------------
hkalyoncu's Profile: http://forums.novell.com/member.php?userid=63527
View this thread: http://forums.novell.com/showthread.php?t=450687