Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > BIRT
BIRT Forum d'entraide sur BIRT (Business Intelligence and Reporting Tools). Avant de poster --> FAQ BIRT,Tutoriels BIRT
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 28/07/2006, 10h43   #1
Invité de passage
 
Inscription : janvier 2006
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2006
Messages : 22
Points : 4
Points : 4
Par défaut ReportEngine : erreur lors de la génération d'un rapport

Bonjour,
je suis en train de prendre en main BIRT (du moins j'essaie) et j'ai un soucis plutôt incompréhensible.

J'ai réalisé un programme qui me permet de générer un rapport au format HTML que voici :
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
53
54
55
56
 
	static void generation(String adrsDesign, String adrsRapport) throws EngineException{
		EngineConfig config;
		ReportEngine engine;
 
		try{
			//Déclaration de la configuration du Report Engine
			config = new EngineConfig( );
			config.setEngineHome("C:/birt-runtime-2_1_0/ReportEngine");
			config.setLogConfig(null, Level.WARNING);
 
			//Récupération du report
			engine = new ReportEngine(config);
			engine.changeLogLevel(Level.WARNING);
			IReportRunnable design = engine.openReportDesign(adrsDesign);
 
			//Configuration du format de l'image générée du rapport (ici : une image SVG)
			HTMLRenderContext renderContext = new HTMLRenderContext();
			renderContext.setImageDirectory("C:/Birt/images");			
			renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
 
			//Configuration du fichier génére pour le rapport (ici : un fichier HTML)
			HashMap<String, HTMLRenderContext> contextMap = new HashMap<String, HTMLRenderContext>();
			contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,renderContext);
 
			//Mise en place des options portant sur le fichier HTML généré (ici : définition d'un chemin et nom par défaut)
			HTMLRenderOption options = new HTMLRenderOption();
			options.setOutputFileName(adrsRapport);
 
			//Création et Mise à jour des options du générateur de rapport 
			IRunAndRenderTask task = engine.createRunAndRenderTask(design);
			task.setAppContext(contextMap);
			task.setRenderOption(options);
 
			//Lancement de la génération
			task.run();
 
			//Destruction des éléments définis précédemment
			task.close();
			engine.destroy();
 
		} catch(Exception ex){
			ex.printStackTrace();
		}
 
		System.out.println("Terminé");
	}
 
 
        public static void main(String[] args) {
		try	{
			generation("C:/Birt/test.rptdesign","C:/Birt/rapport.html");	
		} catch ( Exception e ) {
			e.printStackTrace();
		}
	}
Quand je le lance, aucun soucis il me génère bien le rapport !

Mais quand je change ma fonction
Code :
static void generation(...)
en
Code :
public void generation(...)
et que je l'appelle à partir d'un autre programme j'ai l'erreur suivante :

Citation:
28 juil. 2006 10:01:51 org.eclipse.birt.report.engine.api.impl.ReportEngine setupScriptScope
INFO: Error occurs while initialze script scope
org.mozilla.javascript.EvaluatorException: Il est impossible d'ajouter une propriété à un objet fermé ()
at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:76)
at org.mozilla.javascript.Context.reportRuntimeError(Context.java:591)
at org.mozilla.javascript.Context.reportRuntimeError(Context.java:630)
at org.mozilla.javascript.Context.reportRuntimeError0(Context.java:600)
at org.mozilla.javascript.ScriptableObject.addSlot(ScriptableObject.java:1685)
at org.mozilla.javascript.ScriptableObject.getSlotToSet(ScriptableObject.java:1647)
at org.mozilla.javascript.ScriptableObject.put(ScriptableObject.java:247)
at org.mozilla.javascript.IdScriptable.put(IdScriptable.java:111)
at org.mozilla.javascript.ScriptableObject.defineProperty(ScriptableObject.java:1077)
at org.mozilla.javascript.IdScriptable.defineProperty(IdScriptable.java:194)
at org.mozilla.javascript.ScriptableObject.defineProperty(ScriptableObject.java:1103)
at org.mozilla.javascript.IdScriptable.addIdFunctionProperty(IdScriptable.java:451)
at org.mozilla.javascript.NativeString.fillConstructorProperties(NativeString.java:71)
at org.mozilla.javascript.IdScriptable.addAsPrototype(IdScriptable.java:424)
at org.mozilla.javascript.NativeString.init(NativeString.java:57)
at org.mozilla.javascript.Context.initStandardObjects(Context.java:703)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.setupScriptScope(ReportEngine.java:120)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEngine.java:87)
at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:13)
at org.eclipse.birt.report.engine.api.ReportEngine.<init>(ReportEngine.java:54)
at caterpillar.genReport.Test.generation(Test.java:30)
at thales.gui.view.VuePieChart.initialize(VuePieChart.java:36)
at thales.gui.view.VuePieChart.<init>(VuePieChart.java:27)
at thales.gui.view.MainFrame.getPVuePieChart(MainFrame.java:447)
at thales.gui.view.MainFrame$4.actionPerformed(MainFrame.java:131)
at thales.gui.view.GlobalHotkeyManager.dispatchEvent(GlobalHotkeyManager.java:43)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Si quelqu'un pouvait me dire à quoi c'est dû ça m'aiderai beaucoup.

Merci d'avance.
carotte31 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/07/2006, 10h45   #2
BiM
Modératrice
 
Avatar de BiM
 
Femme
Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT
Inscription : janvier 2005
Messages : 7 299
Détails du profil
Informations personnelles :
Sexe : Femme
Âge : 26
Localisation : France, Haute Garonne (Midi Pyrénées)

Informations professionnelles :
Activité : Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT

Informations forums :
Inscription : janvier 2005
Messages : 7 299
Points : 8 650
Points : 8 650
As tu mis des scripts dans ton état ?
__________________
__~{@ BiM - Modératrice "Business Intelligence" @}~
Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT
___________.~{@ Lapine crétine @}~
BiM est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/07/2006, 10h53   #3
Invité de passage
 
Inscription : janvier 2006
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2006
Messages : 22
Points : 4
Points : 4
non j'en ai pas définit mais quand je lance mon programme et que je vais visualiser mon état il y des scripts en commentaires ! Est-ce normal ?
carotte31 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/07/2006, 10h59   #4
BiM
Modératrice
 
Avatar de BiM
 
Femme
Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT
Inscription : janvier 2005
Messages : 7 299
Détails du profil
Informations personnelles :
Sexe : Femme
Âge : 26
Localisation : France, Haute Garonne (Midi Pyrénées)

Informations professionnelles :
Activité : Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT

Informations forums :
Inscription : janvier 2005
Messages : 7 299
Points : 8 650
Points : 8 650
Hum... fais gaffe parce desfois BIRT enregistre mal. Ferme et réouvre et ton état et regarde s'il a bien pris en compte les modifications. Vérifie que tout tes scripts soient en commentaires.
__________________
__~{@ BiM - Modératrice "Business Intelligence" @}~
Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT
___________.~{@ Lapine crétine @}~
BiM est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/07/2006, 11h10   #5
Invité de passage
 
Inscription : janvier 2006
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2006
Messages : 22
Points : 4
Points : 4
oui ils sont en commentaire !

Mais ce que je comprend pas c'est :
- d'où sortent ces scripts que je n'ai pas écrits
- pourquoi ça marche quand je l'appelle à partir du main et pourquoi ça marche pas quand je l'appelle à partir d'un autre programme
carotte31 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/07/2006, 11h19   #6
BiM
Modératrice
 
Avatar de BiM
 
Femme
Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT
Inscription : janvier 2005
Messages : 7 299
Détails du profil
Informations personnelles :
Sexe : Femme
Âge : 26
Localisation : France, Haute Garonne (Midi Pyrénées)

Informations professionnelles :
Activité : Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT

Informations forums :
Inscription : janvier 2005
Messages : 7 299
Points : 8 650
Points : 8 650
Hum en fait, c'est pas à l'éxécution de l'état donc ca ne vient pas de là, excuse moi.

La ligne trente de Test.java c'est bien celle ci ?
Code :
engine = new ReportEngine(config);
Peux-tu attacher le fichier Test.java à ton prochain message s'il te plaît ?
__________________
__~{@ BiM - Modératrice "Business Intelligence" @}~
Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT
___________.~{@ Lapine crétine @}~
BiM est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/07/2006, 15h45   #7
Invité de passage
 
Inscription : janvier 2006
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2006
Messages : 22
Points : 4
Points : 4
bon j'ai fait plein de tests et je t'avouerai je ne comprends rien, un coup ça marche un coup ça marche pas Du coup je te mets mon projet test en entier.

Je vais continuer de mon côté à faire des tests mais je commence à ne plus avoir d'idée.

Je te tiendrai au courant de mon avancement.
Fichiers attachés
Type de fichier : rar VisualisationRapport.rar (8,5 Ko, 5 affichages)
carotte31 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/08/2006, 08h54   #8
Invité de passage
 
Inscription : janvier 2006
Messages : 22
Détails du profil
Informations forums :
Inscription : janvier 2006
Messages : 22
Points : 4
Points : 4
Bon je pense avoir ciblé le problème.
En fait j'ai fait énormément de tests et il s'avère que j'ai cette erreur lorsque j'appelle mon programme à partir d'un autre projet java qui a un répertoire source "src" et ses packages définis dedans.
Pour tous les autres projets java qui n'ont pas ce répertoire source "src", tout fonctionne à merveille.
Je ne sais pas à quoi c'est dû mais il me semble que ça vient de là
carotte31 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 12h17.


 
 
 
 
Partenaires

Hébergement Web