here is my jrxml file
<?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 6.0.1.final using JasperReports Library version 6.0.0 --> <!-- 2015-05-14T10:50:59 --> <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="TestTestMultiQuery" pageWidth ="595" pageHeight ="842" columnWidth="555" leftMargin="20" rightMargin ="20" topMargin ="20" bottomMargin="20" uuid="90abb488-1239-4b84-865e-291aa3094758"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="mysql_db"/> <parameter name="source" class="java.util.Collection"/> <parameter name="p_source" class="java.lang.String" isForPrompting="false"> <defaultValueExpression> <![CDATA[((!$P{source}.isEmpty() && $P{source}!=null)?"":$P{source}.toString().replaceAll("[\\[\\]]", "'").replaceAll(", ", "', '"))]]> </defaultValueExpression> </parameter> <queryString> <![CDATA[select id,title,creator_id from need n where ($X{IN,n.source,p_source})]]> </queryString> <field name="id" class="java.lang.Long"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="title" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="creator_id" class="java.lang.Long"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <background> <band splitType="Stretch"/> </background> <detail> <band height="125" splitType="Stretch"/> </detail> </jasperReport>
here, my parameter source is not-required param. when i tried running this report its showing me
An error has occurred. Please contact your system administrator. (5321)
If I make it manditory i am not getting this error. what might be the issue? and I tried a solution from internet for this kind of error but it(in tomcat/config/server.xml file urlencoding shoudd be utf-8) didn't work.
2 Answers:
Hi,
The error you see is server's input validation, which blocks request containing unwanted symbols. It may be that mandatory flag somehow impacts the data being sent. In would be in order if you look at server log, there is more detailed information about which security input validation rule is affected.
Thanks,
Anton.
Please refer to the following wiki article for detail on input validation rules:
http://community.jaspersoft.com/wiki/jaspersoft-security-changes-and-con...
http://community.jaspersoft.com/wiki/jaspersoft-security-security-config...
Your report design is failing on the security rule with this paramter expressions:
<parameter name="p_source" class="java.lang.String" isForPrompting="false"> <defaultValueExpression> <![CDATA[((!$P{source}.isEmpty() && $P{source}!=null)?"":$P{source}.toString().replaceAll("[\\[\\]]", "'").replaceAll(", ", "', '"))]]> </defaultValueExpression> </parameter>