Problema com JasperReports, formatação da Query

0 respostas
K

Boa tarde caros amigos e amigas do GUJ. Estou com problemas na formatação da Query de um relatório, seguem os dados importantes:

  • arquivo .jrxml
<?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="relHistoricoExecucao" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<property name="ireport.background.image" value="/home/tarcisio/workinf/SIPROT/Source Codes/Siprot/WebContent/resources/img/relatorios/LOGO FUNDO.gif"/>
	<property name="ireport.background.image.properties" value="true,true,0.2,519,-566,386,808,16,16"/>
	<property name="ireport.layers" value="##Wed Dec 28 14:51:15 BRST 2011\nlayer.4.name=Layer 4\nlayer.3.id=3\nlayer.2.visible=true\nlayer.1.name=Layer 1\nlayer.0.visible=true\nlayer.2.id=2\nlayer.2.name=Layer 2\nlayer.3.visible=true\nlayer.1.id=1\nlayer.1.visible=true\nlayer.3.name=Layer 3\nlayer.4.id=4\nlayer.0.id=0\nlayer.0.name=Background\nlayer.4.visible=true"/>
	<parameter name="idProtocolo" class="java.lang.Integer"/>
	<parameter name="pathImg" class="java.lang.String"/>
	<parameter name="sql" class="java.util.Collection">
		<parameterDescription><![CDATA[]]></parameterDescription>
		<defaultValueExpression><![CDATA[select fun.nm_funcionario,
       tmtc.dt_tramitacao,
       eo1.nm_unidade as nm_origem,
       eo2.nm_unidade as nm_destino,
       coalesce(tmtc.ds_protocolo,'') as ds_protocolo,
       coalesce(tmtc.ds_mt_devolucao_protocolo,'') as ds_mt_devolucao_protocolo,
       coalesce(tmtc.ds_mv_cancelamento_protocolo,'') as ds_mv_cancel_protocolo,
       tmtc.nm_matricula_aluno,
       prt.nr_numero_protocolo,
       st.nm_descricao
from protocolo prt inner join tramitacao tmtc on ( prt.id_protocolo=tmtc.id_protocolo )
inner join funcionario fun on(tmtc.id_funcionario=fun.id_funcionario)
inner join estrutura_organizacional eo1 on(eo1.id_unidade=tmtc.id_unidade_origem)
inner join estrutura_organizacional eo2 on(eo2.id_unidade=tmtc.id_unidade_destino)
inner join status_protocolo st on(tmtc.id_status_protocolo=st.id_status_protocolo)
where prt.id_protocolo = $P{idProtocolo}]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[]]>
	</queryString>
	<field name="nm_funcionario" class="java.lang.String"/>
	<field name="dt_tramitacao" class="java.sql.Timestamp"/>
	<field name="nm_origem" class="java.lang.String"/>
	<field name="nm_destino" class="java.lang.String"/>
	<field name="ds_protocolo" class="java.lang.String"/>
	<field name="ds_mt_devolucao_protocolo" class="java.lang.String"/>
	<field name="ds_mv_cancel_protocolo" class="java.lang.String"/>
	<field name="nm_matricula_aluno" class="java.lang.String"/>
	<field name="nr_documento" class="java.lang.String"/>
	<field name="nm_descricao" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="119" splitType="Stretch">
			<staticText>
				<reportElement x="119" y="9" width="317" height="64"/>
				<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Center">
					<font fontName="DejaVu Sans" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[SERVIÇO PÚBLICO FEDERAL
MINISTÉRIO DA EDUCAÇÃO
UNIVERSIDADE FEDERAL DE UBERLÂNDIA
DIRETORIA DE ADMINISTRAÇÃO E CONTROLE ACADÊMICO]]></text>
			</staticText>
			<image>
				<reportElement x="16" y="1" width="72" height="72"/>
				<imageExpression><![CDATA[$P{pathImg}+"BRAZAO.gif"]]></imageExpression>
			</image>
			<image>
				<reportElement x="470" y="21" width="52" height="32"/>
				<imageExpression><![CDATA[$P{pathImg}+"Ufu.jpg"]]></imageExpression>
			</image>
			<elementGroup/>
			<staticText>
				<reportElement x="84" y="84" width="394" height="21"/>
				<textElement textAlignment="Center">
					<font fontName="DejaVu Sans" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[REGISTRO DE TRAMITAÇÕES DO PROTOCOLO]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band height="21" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="29"/>
	</columnHeader>
	<detail>
		<band height="211" splitType="Stretch">
			<textField>
				<reportElement x="189" y="10" width="353" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{nm_funcionario}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="188" y="41" width="354" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{dt_tramitacao}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="188" y="144" width="354" height="41"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{nm_descricao}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="188" y="72" width="354" height="33"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{ds_mv_cancel_protocolo}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="188" y="105" width="354" height="39"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{ds_mt_devolucao_protocolo}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="4" y="10" width="159" height="20"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Funcionário]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="41" width="159" height="20"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Data]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="72" width="159" height="20"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Motivo Cancelamento]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="105" width="159" height="20"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Motivo Devolução]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="144" width="159" height="20"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Status]]></text>
			</staticText>
		</band>
	</detail>
	<columnFooter>
		<band height="45" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="54" splitType="Stretch">
			<staticText>
				<reportElement x="4" y="43" width="84" height="11"/>
				<textElement>
					<font fontName="DejaVu Sans" size="9"/>
				</textElement>
				<text><![CDATA[Uberlândia/MG,]]></text>
			</staticText>
			<textField isStretchWithOverflow="true" pattern="dd MMMMM yyyy">
				<reportElement stretchType="RelativeToBandHeight" x="88" y="43" width="100" height="11"/>
				<textElement>
					<font fontName="DejaVu Sans" size="9"/>
				</textElement>
				<textFieldExpression><![CDATA[new Date()]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band height="31" splitType="Stretch"/>
	</summary>
</jasperReport>

O erro que acontece quando compilo o relatório:

Compiling to file… /home/tarcisio/workinf/SIPROT/Source Codes/Siprot/src/br/ufu/prograd/siprot/relatorios/historicos/relHistoricoExecucao.jasper
Errors compiling /home/tarcisio/workinf/SIPROT/Source Codes/Siprot/src/br/ufu/prograd/siprot/relatorios/historicos/relHistoricoExecucao.jasper!
Compilation exceptions: com.jaspersoft.ireport.designer.compiler.ErrorsCollector@6312994d net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: calculator_relHistoricoExecucao_1330454581662_541140: 149: expecting ‘)’, found ‘fun’ @ line 149, column 29. 1 error at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:100) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:188) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:212) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:516) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: calculator_relHistoricoExecucao_1330454581662_541140: 149: expecting ‘)’, found ‘fun’ @ line 149, column 29. 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:143) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:113) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:125) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:337) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:104) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:71) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:158) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:96) … 6 more
Compilation running time: 116!

Alguém consegue me ajudar?
Sei que está relacionado com o groovy,
Já declarei o parametro [color=orange]$sql[/color] como java.util.colection como foi pedido num tópico que pesquisei na web mas não resolveu.

Obrigado pela atenção de todo(a)s!

Criado 28 de fevereiro de 2012
Respostas 0
Participantes 1