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 02/02/2011, 11h16   #1
Invité de passage
 
Inscription : février 2011
Messages : 4
Détails du profil
Informations forums :
Inscription : février 2011
Messages : 4
Points : 0
Points : 0
Par défaut [2.6] Chart BIRT

Bonjour
j'ai essayé d'intégrer une charte avec Java dans un rapport Birt, j'utilise Birt2.6
La charte a pour source d'information un DataSet deja existant ,donc voila j'ai deux problèmes :
voici mon code :
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
OdaDataSetHandle dataSet = fact.newOdaDataSet("chartDataSet","org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet");
try {
	dataSet.setDataSource("DataBase");
	dataSet.setQueryText("select * from tab1;");
	designHandle.getDataSets().add(dataSet);
} catch (SemanticException e2) {
	// TODO Auto-generated catch block
	e2.printStackTrace();
}
ExtendedItemHandle EX=null;
ChartWithAxes chart=ChartWithAxesImpl.create();
chart.getBlock().setBackground(ColorDefinitionImpl.YELLOW());
chart.getBlock().getOutline().setVisible(true);
chart.setDimension(ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL);
// customize the plot
Plot p = chart.getPlot();
p.getClientArea().setBackground(ColorDefinitionImpl.create(255, 255, 225));
p.getOutline().setVisible(false);
chart.getTitle().getLabel().getCaption().setValue("Simple Bar Chart");
 
// customize the legend
Legend lg = chart.getLegend();
lg.getOutline( ).setVisible( false );
lg.getText().getFont().setSize(16);
lg.getInsets().set(10, 5, 0, 0);
lg.setAnchor(Anchor.NORTH_LITERAL);
 
// customize the X-axis
Axis[] axa = chart.getPrimaryBaseAxes();
Axis xAxisPrimary=axa[0];
xAxisPrimary.setType(AxisType.TEXT_LITERAL);
xAxisPrimary.setCategoryAxis(true);
xAxisPrimary.getMajorGrid().setTickStyle(TickStyle.BELOW_LITERAL);
xAxisPrimary.getOrigin().setType(IntersectionType.VALUE_LITERAL);
xAxisPrimary.getTitle().setVisible(true);
 
// customize the Y-axis
Axis yAxisPrimary = chart.getPrimaryOrthogonalAxis(xAxisPrimary);
yAxisPrimary.getMajorGrid().setTickStyle(TickStyle.LEFT_LITERAL);
yAxisPrimary.setType(AxisType.LINEAR_LITERAL);
yAxisPrimary.getLabel().getCaption().getFont().setRotation(90);
 
// create the category base series
Query query =QueryImpl.create("row[\"nom\"]");
Series Category = SeriesImpl.create();
Category.getDataDefinition().add(query);
Category.setSeriesIdentifier(query);
 
// create the value orthogonal series
Query Q1=QueryImpl.create("row[\"num1\"]");
Series bs1 = (LineSeries) LineSeriesImpl.create();
bs1.getDataDefinition().add(Q1);
bs1.setSeriesIdentifier(Q1);
bs1.getLabel().setVisible(true);
bs1.setLabelPosition(Position.INSIDE_LITERAL);
 
// wrap the base series in the X-axis series definition
SeriesDefinition sdX = SeriesDefinitionImpl.create();
sdX.getSeriesPalette().update(0); 
xAxisPrimary.getSeriesDefinitions().add(sdX);
 
// wrap the orthogonal series in the X-axis series definition
SeriesDefinition sdY = SeriesDefinitionImpl.create();
sdY.getSeriesPalette().update(0);
sdY.getSeries().add(bs1);
yAxisPrimary.getSeriesDefinitions().add(sdY);
sdY.getSeries().add(bs1);
sdX.getSeries().add(Category);
 
try {
	EX=fact.newExtendedItem(null,"Chart");
	try {
		EX.setProperty(ExtendedItemHandle.DATA_SET_PROP,"Data Set");
		EX.setDataSet(dataSet);
		EX.setHeight("250pt");
		EX.setWidth("250pt");
		EX.getReportItem( ).setProperty( "chart.instance", chart );
		designHandle.getBody().add(EX);
	} 
	catch (SemanticException e1) {e1.printStackTrace();}
}
catch (ClassCastException e){e.getMessage();}

le premier c'est que la charte ne retrouve pas les données du DataSet meme si dans la propietée "Binding" de la charte on trouve ma DataSet.
Le deuxième c'est quand j'essai d'acceder à "Edit chart" dans la vue design ben j'ai ce problème dans l'image.
Merci pour votre aide.
zack990 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 24/02/2011, 11h31   #2
Membre Expert
 
Avatar de lazarel
 
Homme
Consultant informatique
Inscription : mai 2007
Messages : 893
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 30
Localisation : France, Haute Garonne (Midi Pyrénées)

Informations professionnelles :
Activité : Consultant informatique
Secteur : Aéronautique - Marine - Espace - Armement

Informations forums :
Inscription : mai 2007
Messages : 893
Points : 1 360
Points : 1 360
Tu peux être plus précis sur ce que tu veux faire
lazarel est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/06/2011, 15h44   #3
Invité régulier
 
Homme
Étudiant
Inscription : juin 2011
Messages : 27
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : juin 2011
Messages : 27
Points : 9
Points : 9
as-tu finalement trouvé les erreurs ?

je cherche à faire la même chose que toi
n0nal 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 07h30.


 
 
 
 
Partenaires

Hébergement Web