Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > Jasper
Jasper Forum d'entraide sur Jasper Reports. Avant de poster --> FAQ Jasper, Tutoriels Jasper
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 02/02/2012, 12h21   #1
Membre du Club
 
Inscription : avril 2008
Messages : 173
Détails du profil
Informations personnelles :
Âge : 36

Informations forums :
Inscription : avril 2008
Messages : 173
Points : 53
Points : 53
Par défaut Bean + JasperServer

Bonjour,

J'essaye d'executer un rapport stocker sur JasperServer en lui passant un bean.
Quand je fait l runReport le serveur me retourne une erreur:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
INFO : org.apache.commons.httpclient.auth.AuthChallengeProcessor - basic authentication scheme selected
java.lang.Exception: 1 - Report design not valid : 
	 1. Field not found : DESTINATAIRE
	at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:392)
	at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:309)
	at com.fdilogbox.artemis.jreport.ReportFactory.makeReport(ReportFactory.java:42)
	at com.fdilogbox.artemis.jreport.ReportFactory.main(ReportFactory.java:51)
Exception in thread "main" java.lang.Exception: 1 - Report design not valid : 
	 1. Field not found : DESTINATAIRE
	at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:392)
	at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:309)
	at com.fdilogbox.artemis.jreport.ReportFactory.makeReport(ReportFactory.java:42)
	at com.fdilogbox.artemis.jreport.ReportFactory.main(ReportFactory.java:51
Mon code Java :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
        ResourceDescriptor resourceDescriptor = new ResourceDescriptor();
 
        resourceDescriptor.setUriString("/Reports/DemandePlan");
 
        Map<String, Object> parameterMap = new HashMap<String, Object>();
 
        Destinataire destinataire = new Destinataire();
        destinataire.setRaisonSociale("Raison sociale");
        destinataire.setEnseigne("MonEnseigne");
        destinataire.setCodeDestinataire("MonCode");
 
        parameterMap.put("DESTINATAIRE", destinataire);
 
        JasperPrint printer = client.runReport(resourceDescriptor, parameterMap);
 
        JasperViewer.viewReport(printer, false, Locale.FRENCH);
Mon report :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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="DemandePlan" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="116"/>
	<property name="ireport.jasperserver.reportUnit" value="/Reports/DemandePlan"/>
	<property name="ireport.jasperserver.url" value="http://fr-dev:8130/jasperserver/services/repository"/>
	<variable name="DESTINATAIRE" class="com.fdilogbox.artemis.model.destinataire.Destinataire"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="131" splitType="Stretch">
			<image>
				<reportElement x="284" y="0" width="129" height="129"/>
				<imageExpression><![CDATA["repo:logo FDI.png"]]></imageExpression>
			</image>
			<textField pattern="dd/MM/yyyy">
				<reportElement x="7" y="46" width="100" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="89" splitType="Stretch">
			<rectangle radius="10">
				<reportElement x="16" y="13" width="202" height="54"/>
			</rectangle>
			<textField>
				<reportElement x="16" y="13" width="202" height="54"/>
				<textElement/>
				<textFieldExpression><![CDATA["Référence à rappeler : " + $F{DESTINATAIRE}.codeDestinataire]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="61" splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="125" splitType="Stretch"/>
	</detail>
	<columnFooter>
		<band height="45" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="54" splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band height="42" splitType="Stretch"/>
	</summary>
</jasperReport>
Au niveau du serveur, j'ai rajouter le Jar conenant la classe Destinataire dans les resources du Report.

Avez vous une idée pour qu'il reconnaisse DESTINATAIRE?
youkoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/02/2012, 14h09   #2
Membre du Club
 
Inscription : avril 2008
Messages : 173
Détails du profil
Informations personnelles :
Âge : 36

Informations forums :
Inscription : avril 2008
Messages : 173
Points : 53
Points : 53
J'ai trouve mon erreur : J'ai mis $P à la place de $V.

Du coup plus de message d'erreur mais il me dit que "le document ne contient aucune page".

Une idée de la cause du problème?
youkoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/02/2012, 16h10   #3
Membre du Club
 
Inscription : avril 2008
Messages : 173
Détails du profil
Informations personnelles :
Âge : 36

Informations forums :
Inscription : avril 2008
Messages : 173
Points : 53
Points : 53
Je n'avait pas lié la source de données au niveau du serveur
youkoun est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 14h22.


 
 
 
 
Partenaires

Hébergement Web