joksy82 Posted August 27, 2010 Share Posted August 27, 2010 Dear All, I'm new to ireport and jasper but i'm really frustating becuase for doing simple thing i have spend many time for nothing.Each modification produce complete different results and really i have no IDEA.If a build only word report the thinngs are almost ok. But Chart are really human demotivational. In fact i start to learn jfreechart for makining and importing as image......But anyway before leaving forever my problem and use another way to achieve what the customer want i have a question for all of you and please try to help me becuase probably it is my error and i didn t see it. The goal is to build a report which report sales chart depending of the payementtype Es VISA MasterCard and so on.I post the code and the pdf produced. Many many thanks Kindly regards!Joksy Code:<?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="sales" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" 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="0"/> <queryString> <![CDATA[sELECT o.creationdate, count(mo.quantita) as quantita ,sum(o.totalepagamento) as soldi,met.nome as pagamento FROM modello_ordine mo inner join ordine o on o.idordine=mo.idordine inner join payementtype met on o.idmetodopagamento=met.payementtype group by o.creationdate order by pagamento]]> </queryString> <field name="creationdate" class="java.sql.Timestamp"/> <field name="quantita" class="java.lang.Long"/> <field name="soldi" class="java.lang.Double"/> <field name="pagamento" class="java.lang.String"/> <group name="pagamenti"> <groupExpression><![CDATA[$F{pagamento}]]></groupExpression> <groupHeader> <band height="521"> <textField> <reportElement x="0" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{pagamento}]]></textFieldExpression> </textField> <timeSeriesChart> <chart> <reportElement x="0" y="20" width="802" height="487"/> <chartTitle/> <chartSubtitle/> <chartLegend/> </chart> <timeSeriesDataset> <timeSeries> <seriesExpression><![CDATA[$F{pagamento}]]></seriesExpression> <timePeriodExpression><![CDATA[$F{creationdate}]]></timePeriodExpression> <valueExpression><![CDATA[$F{quantita}]]></valueExpression> </timeSeries> </timeSeriesDataset> <timeSeriesPlot isShowLines="true" isShowShapes="false"> <plot/> <timeAxisFormat> <axisFormat verticalTickLabels="true"> <labelFont/> <tickLabelFont/> </axisFormat> </timeAxisFormat> <valueAxisFormat> <axisFormat verticalTickLabels="false"> <labelFont/> <tickLabelFont/> </axisFormat> </valueAxisFormat> </timeSeriesPlot> </timeSeriesChart> </band> </groupHeader> </group> <background> <band splitType="Stretch"/> </background> <title> <band height="14" splitType="Stretch"/> </title> <summary> <band height="162" splitType="Stretch"/> </summary></jasperReport> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now