Jump to content
We've recently updated our Privacy Statement, available here ×

$X parameter is not working


ananth890
Go to solution Solved by reportdev,

Recommended Posts

Hi Gurus,

I am creating simple report, I would like to pass multi values in parameter . I am using Jasper studio 6.1.1.

so i created one parameter and updated query 

select company_id,
Legal_Name, Created_Date,Fed_Tax_Id_Nbr,Membership_Id,Phone_Nbr,Company_Status_Code
from company
where  $X{IN,Legal_Name,LegName}
 
class type :  java.util.Collections
 
it is not prompting parameter ( i cecked  is prompt option) report is displaying all records. 
I mean parameter is skipping . if i convert that parameter to  single value then it is working 
 like where Legal_name  = $P{LegName}
 
I am not sure why it is happening  please help me .
here is jrxml  code
 
?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.1.1.final using JasperReports Library version 6.1.1  -->
<!-- 2016-11-10T12:14:14 -->
<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="Test Report 1" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f5743a28-35ba-4336-b309-c06e22d06154">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="DEV4"/>
<property name="ireport.jasperserver.url" value="https://pmx-dev4-jasper.saas-n.com/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="superuser"/>
<property name="ireport.jasperserver.report.resource" value="/organizations/PaymodeX/SandBox/Test_Report_1_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/organizations/PaymodeX/SandBox/Test_Report_1"/>
<parameter name="LegName" class="java.util.Collections" nestedType="java.lang.String"/>
<queryString>
<![CDATA[select company_id,
Legal_Name, Created_Date,Fed_Tax_Id_Nbr,Membership_Id,Phone_Nbr,Company_Status_Code
from company
where  $X{IN,Legal_Name,LegName}]]>
</queryString>
<field name="COMPANY_ID" class="java.math.BigDecimal"/>
<field name="LEGAL_NAME" class="java.lang.String"/>
<field name="CREATED_DATE" class="java.sql.Timestamp"/>
<field name="FED_TAX_ID_NBR" class="java.lang.String"/>
<field name="MEMBERSHIP_ID" class="java.math.BigDecimal"/>
<field name="PHONE_NBR" class="java.lang.String"/>
<field name="COMPANY_STATUS_CODE" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="26" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="37" splitType="Stretch">
<staticText>
<reportElement x="8" y="0" width="100" height="30" uuid="7a692544-26bd-4ad1-b2b3-f8ba3ce03097"/>
<text><![CDATA[COMPANY_ID]]></text>
</staticText>
<staticText>
<reportElement x="111" y="0" width="100" height="30" uuid="72436c9c-90d2-406f-9edd-04a7a11f8512"/>
<text><![CDATA[LEGAL_NAME]]></text>
</staticText>
<staticText>
<reportElement x="215" y="0" width="100" height="30" uuid="720e8de8-71e3-45e6-b25a-108b627055c1"/>
<text><![CDATA[CREATED_DATE]]></text>
</staticText>
<staticText>
<reportElement x="322" y="0" width="100" height="30" uuid="b9f7dcd8-645e-44b1-a881-fade1ef2ba50"/>
<text><![CDATA[FED_TAX_ID_NBR]]></text>
</staticText>
<staticText>
<reportElement x="425" y="0" width="100" height="30" uuid="74e6cda1-f321-4210-8ad6-e8d2c343ed48"/>
<text><![CDATA[memberSHIP_ID]]></text>
</staticText>
<staticText>
<reportElement x="532" y="0" width="100" height="30" uuid="eb715224-3153-44e4-aae8-b15eadd6c1f6"/>
<text><![CDATA[PHONE_NBR]]></text>
</staticText>
<staticText>
<reportElement x="638" y="0" width="100" height="30" uuid="a412c34f-f2e6-44e4-815a-9fb2fde1ba26"/>
<text><![CDATA[COMPANY_STATUS_CODE]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="46" splitType="Stretch">
<textField>
<reportElement x="8" y="5" width="100" height="30" uuid="0e153bfa-2576-4a7a-a504-c8f249cca914"/>
<textFieldExpression><![CDATA[$F{COMPANY_ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="111" y="4" width="100" height="30" uuid="38aac2c9-7d52-48ca-983e-d79afdbed2aa"/>
<textFieldExpression><![CDATA[$F{LEGAL_NAME}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="215" y="7" width="100" height="30" uuid="1ff64753-98a7-40e1-85cb-96f537f3d9be"/>
<textFieldExpression><![CDATA[$F{CREATED_DATE}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="322" y="4" width="100" height="30" uuid="3be2e29f-4593-4006-bb58-016bbd80cb50"/>
<textFieldExpression><![CDATA[$F{FED_TAX_ID_NBR}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="425" y="3" width="100" height="30" uuid="d6325bc2-fbc4-4e94-8db5-2562bc6b4928"/>
<textFieldExpression><![CDATA[$F{MEMBERSHIP_ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="532" y="5" width="100" height="30" uuid="0f6f0103-c6e4-4792-9c31-a599eda6d9a5"/>
<textFieldExpression><![CDATA[$F{PHONE_NBR}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="638" y="8" width="100" height="30" uuid="d09c2cdf-49a6-4d50-8a92-94e3bd8e5ba6"/>
<textFieldExpression><![CDATA[$F{COMPANY_STATUS_CODE}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="15" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="7" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="20" splitType="Stretch"/>
</summary>
</jasperReport>
 
 
Thanks in advance for your support.

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 4 weeks 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...