Jump to content
JasperReports Library 7.0 is now available ×

Sending parms to store proc from jrxml


lconklin

Recommended Posts

How do I send dates to a store proc in jrxml

This works

<queryString>
  <![CDATA[sELECT * FROM jobcosting.sp_jclogtimeexceptions('11/01/2008','11/30/2008')

this does not

<queryString>
  <![CDATA[sELECT * FROM jobcosting.sp_jclogtimeexceptions($P(LogInDate), $P(LogOutDate))

The error I am getting is

Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "$" 

I need the user to by able to enter the date range of the dataset he wants.

I am using postgresql, my function looks like

CREATE OR REPLACE FUNCTION "jobcosting"."sp_jclogtimeexceptions" (login date, logout date) RETURNS SETOF record

The parm in jrxml is <parameter name="LogInDate" class="java.lang.String"/>

Thank you

 

 

 

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

I got a strange error. My .jrxml file has a  query parameter
<parameter name="practiceIds" class="java.lang.String" isForPrompting="true">
<defaultValueExpression><![CDATA[new String("111")]]></defaultValueExpression>
</parameter>

I retrieve data from Oracle stored procedure:
<![CDATA[sELECT * from table(summary.my_summary($P{practiceIds}))]]>

It works fine in iReport 3.1.2.
When I run in JasperServer,it fails with error:
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
  oracle.jdbc.driver.T2CStatement.t2cParseExecuteDescribe(Loracle/jdbc/driver/OracleStatement;
oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe().

When I tried
<![CDATA[sELECT * from table(summary.my_summary('$P!{practiceIds}'))]]>,
it does not fail, but does not accept the actual parameter value that I pass ("222"), always using the default value "111"

Any advice?

 

Link to comment
Share on other sites

The standard SQL data sources assume a result set from a query, not a stored procedure.

You will need to have a custom data source for this.

There is a project on JasperForge for Oracle stored procedures: http://jasperforge.org/plugins/project/project_home.php?group_id=173

Check out the source, compile it and deploy it as a custom data source into JasperServer. See the user guide for details on custom data sources.

 

Sherman

Jaspersoft

Link to comment
Share on other sites

How should I define (what java class to use) a parameter that is multi-select-from-query Input control? I tried java.util.List, but got "jsexception.unknown.parameter.type.for.multiple.value.input" . The control itself populates all right. Would you recommend some materials describing the topic? Thanks.

 

Link to comment
Share on other sites

  • 1 year later...

hi ..

 

any one know aboun this bug

"

com.jaspersoft.jasperserver.api.JSException: jsexception.unknown.parameter.type.for.multiple.value.input

com.jaspersoft.jasperserver.api.JSException: jsexception.unknown.parameter.type.for.multiple.value.input	at com.jaspersoft.jasperserver.war.action.ReportParametersAction.getParameterMultiValue(ReportParametersAction.java:1223)	at com.jaspersoft.jasperserver.war.action.ReportParametersAction.bindParameterValues(ReportParametersAction.java:1088)	at com.jaspersoft.jasperserver.war.action.ReportParametersAction.getParameterValues(ReportParametersAction.java:216)	at com.jaspersoft.jasperserver.war.action.ViewReportAction.executeReport(ViewReportAction.java:368)	at com.jaspersoft.jasperserver.war.action.ViewReportAction.runReport(ViewReportAction.java:255)	at sun.reflect.GeneratedMethodAccessor505.invoke(Unknown Source)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java:585)	at org.springframework.webflow.action.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:98)	at org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:123)	at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)	at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)	at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:79) "

pls.......respondeeeeeeeeee....

 

 

Regards

Link to comment
Share on other sites

  • 2 months later...

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