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

menghile01

Members
  • Posts

    2
  • Joined

  • Last visited

menghile01's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. only in jasperserver i have this error : com.jaspersoft.jasperserver.api.JSExceptionWrapper: Error evaluating expression : Source text : Integer.parseInt($P{PERIODO_RIFERIMENTO}.toString().substring(0,4))I have created a parameter $P{ANNO} that converts one string in a decimal the source code is the following : <?xml version="1.0" encoding="UTF-8"?> <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="Estrazione_conteggio_clienti_bdg" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.5"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <property name="ireport.jasperserver.reportUnit" value="/REPORT/CARLO_IORI/ESTRAZIONE_CONTEGGIO_CLIENTI_BDG"/> <property name="ireport.jasperserver.url" value="http://172.32.254.36:8080/jasperserver/services/repository"/> <parameter name="PERIODO_RIFERIMENTO" class="java.lang.String"> <parameterDescription><![CDATA[]]></parameterDescription> <defaultValueExpression><![CDATA[]]></defaultValueExpression> </parameter> <parameter name="ANNO" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA[integer.parseInt($P{PERIODO_RIFERIMENTO}.toString().substring(0,4))]]></defaultValueExpression> </parameter> <queryString> <![CDATA[select T1.macrosettore, T1.settore, count(*) conteggio from (select distinct T1.settore, T1.macrosettore, T1.intestatario from (select T1.codice_raggruppatore, T1.codice_cliente, T1.intestatario, T2.stato_cliente, T1.ragione_sociale, T1.statistiche_canale, T1.macrosettore, T1.statistiche_categoria_merce, T1.settore, T1.conteggio from (select T1.codice_raggruppatore, T1.codice_cliente, T2.codice_cliente_fatturazione intestatario, T1.ragione_sociale, T1.statistiche_canale, T1.macrosettore, T1.statistiche_categoria_merce, T1.settore, T1.conteggio from (select T1.codice_raggruppatore, T1.codice_cliente, T1.ragione_sociale, T1.statistiche_canale, T1.macrosettore, T1.statistiche_categoria_merce, T1.settore, T1.conteggio from (select T1.codice_raggruppatore, T1.codice_cliente, T1.ragione_sociale, T1.statistiche_canale, T1.macrosettore, T1.statistiche_categoria_merce, T1.settore, locate('X*',T1.ragione_sociale,1)test, count(*)conteggio from (select T1.codice_cliente, T1.ragione_sociale, T1.codice_raggruppatore, T1.tipo_raggruppatore, T1.statistiche_canale, T1.macrosettore, T1.statistiche_categoria_merce, T1.settore, coalesce(T2.codice_raggruppatore,9999)controllo from (select T1.codice_cliente, T1.ragione_sociale, T1.codice_raggruppatore, T1.tipo_raggruppatore, T1.statistiche_canale, T2.descrizione macrosettore, T1.statistiche_categoria_merce, T3.descrizione settore from (select T1.codice_cliente, T1.ragione_sociale, T1.codice_raggruppatore, T2.tipo_raggruppatore, T2.statistiche_canale, T2.statistiche_categoria_merce from (select T1.codice_cliente, T2.ragione_sociale, T1.codice_raggruppatore from (select T1.codice_cliente, t1.data_inizio_validita, T1.data_fine_validita, T2.codice_raggruppatore from (select t1.codice_cliente, t1.data_inizio_validita, t1.data_fine_validita, t1.anno_inizio, t1.anno_fine from (select codice_cliente, data_inizio_validita, data_fine_validita, integer(substr(char(data_inizio_validita),1,4)) as anno_inizio, integer(substr(char(data_fine_validita),1,4)) as anno_fine from danbb00f)t1 where t1.anno_inizio <= $P{ANNO} and t1.anno_fine >= $P{ANNO}) T1 left join danbb00f T2 on (T1.codice_cliente = T2.codice_cliente and t1.data_inizio_validita = t2.data_inizio_validita and T1.data_fine_validita = T2.data_fine_validita) where T2.tipo_legame_statistico = 'BDG')T1 left join danac00f T2 on (T1.codice_cliente = T2.codice_cliente and T2.tipo_cliente = 'D') where T2.stato_cliente <> 'A')T1 left join danba00f T2 on (T1.codice_raggruppatore = T2.codice_raggruppatore) where T2.tipo_raggruppatore <>'CNB')T1 left join tabs12 T2 on (T1.statistiche_canale = T2.statistiche_canale) left join tabs14 T3 on (T1.statistiche_categoria_merce = T3.statistiche_categoria_merce))T1 left join (select distinct T1.codice_raggruppatore from dstbg00f T1 left join danba00f T2 on (T1.codice_raggruppatore = T2.codice_raggruppatore) where T2.tipo_raggruppatore <> 'CNB' and T1.periodo_riferimento = $P{PERIODO_RIFERIMENTO}) T2 on (T1.codice_raggruppatore = T2.codice_raggruppatore) where coalesce(T2.codice_raggruppatore,9999)<> 9999)T1 group by T1.codice_raggruppatore,T1.codice_cliente, T1.ragione_sociale, T1.statistiche_canale, T1.macrosettore, T1.statistiche_categoria_merce, T1.settore, locate('X*',T1.ragione_sociale,1))T1 where T1.test = 0)T1 left join danac00f T2 on (T1.codice_cliente = T2.codice_cliente and T2.tipo_cliente = 'D'))T1 left join danac00f T2 on (T1.intestatario = T2.codice_cliente and T2.tipo_cliente = 'C') where T2.stato_cliente <> 'A')T1)T1 group by T1.settore, T1.macrosettore order by T1.macrosettore, T1.settore]]> </queryString> <field name="MACROSETTORE" class="java.lang.String"/> <field name="SETTORE" class="java.lang.String"/> <field name="CONTEGGIO" class="java.lang.Integer"/> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="614" height="79"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14" isBold="true"/> </textElement> <text><![CDATA[CONTEGGIO CLIENTI-INTESTATARI CON RAGGRUPPATORI A BUDGET ANNO : ]]></text> </staticText> <textField> <reportElement x="614" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$P{PERIODO_RIFERIMENTO}]]></textFieldExpression> </textField> <textField> <reportElement x="614" y="20" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$P{ANNO}]]></textFieldExpression> </textField> </band> </title> <columnHeader> <band height="20" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="267" height="20"/> <box> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[MACROSETTORE]]></text> </staticText> <staticText> <reportElement x="267" y="0" width="267" height="20"/> <box> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[sETTORE]]></text> </staticText> <staticText> <reportElement x="534" y="0" width="267" height="20"/> <box> <pen lineWidth="0.5"/> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[CONTEGGIO]]></text> </staticText> </band> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="267" height="20"/> <box> <pen lineWidth="0.25"/> <topPen lineWidth="0.25"/> <leftPen lineWidth="0.25"/> <bottomPen lineWidth="0.25"/> <rightPen lineWidth="0.25"/> </box> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{MACROSETTORE}]]></textFieldExpression> </textField> <textField> <reportElement x="267" y="0" width="267" height="20"/> <box> <pen lineWidth="0.25"/> <topPen lineWidth="0.25"/> <leftPen lineWidth="0.25"/> <bottomPen lineWidth="0.25"/> <rightPen lineWidth="0.25"/> </box> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{SETTORE}]]></textFieldExpression> </textField> <textField> <reportElement x="534" y="0" width="267" height="20"/> <box> <pen lineWidth="0.25"/> <topPen lineWidth="0.25"/> <leftPen lineWidth="0.25"/> <bottomPen lineWidth="0.25"/> <rightPen lineWidth="0.25"/> </box> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{CONTEGGIO}]]></textFieldExpression> </textField> </band> </detail> </jasperReport> the parameter is used in the following SQL : from (select codice_cliente, data_inizio_validita, data_fine_validita, integer(substr(char(data_inizio_validita),1,4)) as anno_inizio, integer(substr(char(data_fine_validita),1,4)) as anno_fine from danbb00f)t1 where t1.anno_inizio <= $P{ANNO} and t1.anno_fine >= $P{ANNO}) T1 where did i make a mistake ? thanks in advance
  2. Hi, excuse me for my english... I have to pass integer values ​​to a query, these values ​​will get from this additional query : SELECT DISTINCT substr(char(PERIODO_RIFERIMENTO),1,4)||'-'||substr(char(PERIODO_RIFERIMENTO),5,2)||'-'||substr(char(PERIODO_RIFERIMENTO),7,2)as DATE_PER_RIF, PERIODO_RIFERIMENTO FROM DSTBG00F where [PERIODO_RIFERIMENTO] is the integer value i want to use I create a parameter of type "java.util.collection" for use in a further query according to this scheme : SELECT * FROM ORDERS WHERE $X{IN,PERIODO_RIFERIMENTO, PERIODO_RIFERIMENTO} unfortunately java.util.collecion does not allow you to use variables of type integer, how can I fix it? thanks in advance Stefano Baricchi
×
×
  • Create New...