123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <jasperReport name="PieChartReport" language="java" columnCount="2" pageWidth="595" pageHeight="842" columnWidth="270" columnSpacing="15" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" uuid="166628aa-90af-4c8f-a71b-2eaadee2f0e1">
- <style name="Sans_Normal" default="true" fontName="DejaVu Sans" fontSize="8.0" bold="false" italic="false" underline="false" strikeThrough="false"/>
- <style name="Sans_Bold" fontName="DejaVu Sans" fontSize="8.0" bold="true" italic="false" underline="false" strikeThrough="false"/>
- <style name="Sans_Italic" fontName="DejaVu Sans" fontSize="8.0" bold="false" italic="true" underline="false" strikeThrough="false"/>
- <style name="Serif_Normal" fontName="DejaVu Serif" fontSize="10.0" bold="false" italic="false" underline="false" strikeThrough="false"/>
- <style name="Serif_Bold" fontName="DejaVu Serif" fontSize="10.0" bold="true" italic="false" underline="false" strikeThrough="false"/>
- <parameter name="ReportTitle" class="java.lang.String"/>
- <parameter name="MaxOrderID" class="java.lang.Integer"/>
- <query language="sql"><![CDATA[SELECT * FROM Orders WHERE OrderID <= $P{MaxOrderID} ORDER BY ShipCountry]]></query>
- <field name="ShippedDate" class="java.sql.Timestamp"/>
- <field name="ShipCountry" class="java.lang.String"/>
- <field name="RequiredDate" class="java.sql.Timestamp"/>
- <field name="CustomerID" class="java.lang.String"/>
- <field name="OrderID" class="java.lang.Integer"/>
- <field name="ShipName" class="java.lang.String"/>
- <field name="ShipVia" class="java.lang.Integer"/>
- <field name="ShipPostalCode" class="java.lang.String"/>
- <field name="OrderDate" class="java.sql.Timestamp"/>
- <field name="ShipCity" class="java.lang.String"/>
- <field name="ShipAddress" class="java.lang.String"/>
- <field name="EmployeeID" class="java.lang.Integer"/>
- <field name="ShipRegion" class="java.lang.String"/>
- <field name="Freight" class="java.lang.Double"/>
- <variable name="FirstLetter" resetType="None" class="java.lang.String">
- <expression><![CDATA[$F{ShipCountry}.substring(0, 1).toUpperCase()]]></expression>
- </variable>
- <variable name="FirstLetterCount" resetType="Group" incrementType="Group" calculation="Count" resetGroup="ChartGroup" incrementGroup="FirstLetterGroup" class="java.lang.Integer">
- <expression><![CDATA[Boolean.TRUE]]></expression>
- </variable>
- <variable name="FirstLetterMin" resetType="Group" calculation="Lowest" resetGroup="ChartGroup" class="java.lang.String">
- <expression><![CDATA[$V{FirstLetter}]]></expression>
- </variable>
- <variable name="FirstLetterMax" resetType="Group" calculation="Highest" resetGroup="ChartGroup" class="java.lang.String">
- <expression><![CDATA[$V{FirstLetter}]]></expression>
- </variable>
- <variable name="FreightSumChartGroup" resetType="Group" calculation="Sum" resetGroup="ChartGroup" class="java.lang.Double">
- <expression><![CDATA[$F{Freight}]]></expression>
- </variable>
- <variable name="FreightSumCountryGroup" resetType="Group" calculation="Sum" resetGroup="CountryGroup" class="java.lang.Double">
- <expression><![CDATA[$F{Freight}]]></expression>
- </variable>
- <variable name="FreightSumColumn" resetType="Column" calculation="Sum" class="java.lang.Double">
- <expression><![CDATA[$F{Freight}]]></expression>
- </variable>
- <variable name="FreightSumPage" resetType="Page" calculation="Sum" class="java.lang.Double">
- <expression><![CDATA[$F{Freight}]]></expression>
- </variable>
- <variable name="FreightSumReport" calculation="Sum" class="java.lang.Double">
- <expression><![CDATA[$F{Freight}]]></expression>
- </variable>
- <variable name="DateHighestCountryGroup" resetType="Group" calculation="Highest" resetGroup="CountryGroup" class="java.sql.Timestamp">
- <expression><![CDATA[$F{OrderDate}]]></expression>
- </variable>
- <variable name="RegionCountCountryGroup" resetType="Group" calculation="Count" resetGroup="CountryGroup" class="java.lang.Integer">
- <expression><![CDATA[$F{ShipRegion}]]></expression>
- </variable>
- <group name="ChartGroup" minHeightToStartNewPage="200" startNewColumn="true">
- <expression><![CDATA[($V{FirstLetterCount} - 1) / 3]]></expression>
- <groupHeader>
- <band height="250">
- <element kind="rectangle" uuid="3ecfb716-1ae4-42d5-a6b6-ad4c99944ebf" x="0" y="14" width="270" height="11" forecolor="#FFDDDD" backcolor="#FFDDDD"/>
- <element kind="staticText" uuid="59abbdd0-29d2-4c98-b983-f35db84ade78" mode="Opaque" x="0" y="14" width="130" height="11" forecolor="#FF0000" backcolor="#FFDDDD" underline="true" style="Sans_Italic">
- <text><![CDATA[Countries Starting With Letter :]]></text>
- </element>
- <element kind="textField" uuid="859fc8d2-b3c5-4cc5-8dbc-1d52fed74657" mode="Opaque" x="130" y="14" width="20" height="11" forecolor="#FF0000" backcolor="#FFDDDD" evaluationTime="Group" evaluationGroup="ChartGroup" hTextAlign="Right" style="Sans_Bold">
- <expression><![CDATA[$V{FirstLetterMin}]]></expression>
- </element>
- <element kind="staticText" uuid="5516c71a-79f0-4b28-b3c4-bec58d2d23e0" mode="Opaque" x="150" y="14" width="20" height="11" forecolor="#FF0000" backcolor="#FFDDDD" underline="true" hTextAlign="Center" style="Sans_Italic">
- <text><![CDATA[to]]></text>
- </element>
- <element kind="textField" uuid="538685ce-3ecc-462d-8032-03cf54dd0f50" mode="Opaque" x="170" y="14" width="20" height="11" forecolor="#FF0000" backcolor="#FFDDDD" evaluationTime="Group" evaluationGroup="ChartGroup" style="Sans_Bold">
- <expression><![CDATA[$V{FirstLetterMax}]]></expression>
- </element>
- <element kind="chart" chartType="pie" uuid="a63b38fe-68ce-4bb0-ac09-2735d8a78406" positionType="Float" x="0" y="50" width="270" height="175" evaluationTime="Group" evaluationGroup="ChartGroup">
- <dataset kind="pie" incrementType="Group" resetGroup="ChartGroup" incrementGroup="CountryGroup" resetType="Group">
- <series>
- <keyExpression><![CDATA[$F{ShipCountry}]]></keyExpression>
- <valueExpression><![CDATA[$V{FreightSumCountryGroup}]]></valueExpression>
- <sectionHyperlink linkType="Reference" linkTarget="Blank">
- <hyperlinkReferenceExpression><![CDATA["http://en.wikipedia.org/wiki/" + $F{ShipCountry}]]></hyperlinkReferenceExpression>
- <hyperlinkTooltipExpression><![CDATA["Read more about " + $F{ShipCountry}]]></hyperlinkTooltipExpression>
- </sectionHyperlink>
- </series>
- </dataset>
- <plot labelFormat="{0} {2}" legendLabelFormat="{0} {1}">
- <itemLabel color="#000000" backgroundColor="#FFFFFF"/>
- </plot>
- </element>
- </band>
- </groupHeader>
- <groupFooter>
- <band height="25">
- <element kind="line" uuid="986dd370-4c74-4af8-9d75-f9d7da1407b4" x="0" y="0" width="270" height="1" forecolor="#FF0000"/>
- <element kind="staticText" uuid="025dc667-6992-4d06-a547-377e13a8d1f6" x="0" y="1" width="45" height="11" forecolor="#FF0000" hTextAlign="Right" style="Sans_Bold">
- <text><![CDATA[Count :]]></text>
- </element>
- <element kind="textField" uuid="b27cb487-36f9-483a-9fc9-e97e66493a91" x="45" y="1" width="25" height="11" forecolor="#FF0000" hTextAlign="Right" style="Sans_Bold">
- <expression><![CDATA[$V{ChartGroup_COUNT}]]></expression>
- </element>
- <element kind="staticText" uuid="8234e970-f182-459a-9c85-28ba31a057cf" x="70" y="1" width="140" height="11" forecolor="#FF0000" hTextAlign="Right" style="Sans_Bold">
- <text><![CDATA[Total :]]></text>
- </element>
- <element kind="textField" uuid="4a88c465-65f6-49c1-8c25-45990c55d2e7" x="210" y="1" width="60" height="11" forecolor="#FF0000" pattern="0.00" hTextAlign="Right" style="Sans_Bold">
- <expression><![CDATA[$V{FreightSumChartGroup}]]></expression>
- </element>
- </band>
- </groupFooter>
- </group>
- <group name="FirstLetterGroup">
- <expression><![CDATA[$V{FirstLetter}]]></expression>
- </group>
- <group name="CountryGroup">
- <expression><![CDATA[$F{ShipCountry}]]></expression>
- <groupHeader>
- <band height="15">
- <element kind="line" uuid="db896bfd-f674-443f-a52c-5fe24bf390c2" x="0" y="14" width="270" height="1"/>
- <element kind="textField" uuid="2e9d40c7-3d6f-4db9-839d-eed85965496d" x="10" y="2" width="150" height="11" style="Sans_Bold">
- <expression><![CDATA[$F{ShipCountry}]]></expression>
- </element>
- <element kind="textField" uuid="98ec3108-d055-4788-9dc6-16bcd2d4204c" x="170" y="2" width="100" height="11" evaluationTime="Group" pattern="EEE, MMM d, yyyy" evaluationGroup="CountryGroup" hTextAlign="Right" style="Sans_Bold">
- <expression><![CDATA[$V{DateHighestCountryGroup}]]></expression>
- </element>
- </band>
- </groupHeader>
- <groupFooter>
- <band height="15">
- <element kind="rectangle" uuid="a0573d1d-8c83-4e17-b2bf-1dc306bfb4cf" x="0" y="0" width="270" height="11" forecolor="#C0C0C0" backcolor="#C0C0C0"/>
- <element kind="staticText" uuid="ea12ba40-9bc8-4f9e-a8a8-a1f1d279a8a8" mode="Opaque" x="0" y="0" width="45" height="11" backcolor="#C0C0C0" hTextAlign="Right" style="Sans_Bold">
- <text><![CDATA[Count :]]></text>
- </element>
- <element kind="textField" uuid="51a48b2c-1769-4a7f-b921-49ca6e859bdf" mode="Opaque" x="45" y="0" width="25" height="11" backcolor="#C0C0C0" hTextAlign="Right" style="Sans_Bold">
- <expression><![CDATA[$V{CountryGroup_COUNT}]]></expression>
- </element>
- <element kind="staticText" uuid="d69c36fb-5b5a-4d0e-8b7a-b96caabe9b3c" mode="Opaque" x="70" y="0" width="140" height="11" backcolor="#C0C0C0" hTextAlign="Right" style="Sans_Bold">
- <text><![CDATA[Total :]]></text>
- </element>
- <element kind="textField" uuid="7bfddd2f-193f-4767-bb2f-1652c84ea4cb" mode="Opaque" x="210" y="0" width="60" height="11" backcolor="#C0C0C0" pattern="0.00" hTextAlign="Right" style="Sans_Bold">
- <expression><![CDATA[$V{FreightSumCountryGroup}]]></expression>
- </element>
- </band>
- </groupFooter>
- </group>
- <title height="50">
- <element kind="elementGroup"/>
- <element kind="staticText" uuid="f06713e8-e1f1-4dad-a5db-8721c65ac588" x="0" y="0" width="555" height="35" fontSize="22.0" hTextAlign="Center" style="Serif_Bold">
- <text><![CDATA[Pie Chart Report]]></text>
- <box style="Serif_Bold">
- <topPen lineWidth="0.5"/>
- </box>
- </element>
- </title>
- <columnHeader height="11">
- <element kind="rectangle" uuid="4a65b0e7-80e3-4af2-9e44-9172b5ba5c5b" x="0" y="0" width="270" height="11" backcolor="#333333"/>
- <element kind="staticText" uuid="9a105a7f-865d-43c7-a03b-7263c8c9a311" mode="Opaque" x="0" y="0" width="40" height="11" forecolor="#FFFFFF" backcolor="#333333" hTextAlign="Center" style="Sans_Bold">
- <text><![CDATA[Order]]></text>
- </element>
- <element kind="staticText" uuid="0debf846-c7a1-4978-97bc-00f5e65ec68b" mode="Opaque" x="40" y="0" width="145" height="11" forecolor="#FFFFFF" backcolor="#333333" hTextAlign="Center" style="Sans_Bold">
- <text><![CDATA[Name, City]]></text>
- </element>
- <element kind="staticText" uuid="c43d8968-62f5-45cd-8db7-4fe243cf6999" mode="Opaque" x="185" y="0" width="50" height="11" forecolor="#FFFFFF" backcolor="#333333" style="Sans_Bold">
- <text><![CDATA[Date]]></text>
- </element>
- <element kind="staticText" uuid="79da0493-a21d-439f-9e7e-902830dc9b82" mode="Opaque" x="235" y="0" width="35" height="11" forecolor="#FFFFFF" backcolor="#333333" hTextAlign="Right" style="Sans_Bold">
- <text><![CDATA[Freight]]></text>
- </element>
- </columnHeader>
- <detail>
- <band height="13">
- <element kind="textField" uuid="e5ec0153-91b8-4f00-9376-8c628cb9aed7" x="1" y="0" width="35" height="11" hTextAlign="Right">
- <expression><![CDATA[$F{OrderID}]]></expression>
- </element>
- <element kind="textField" uuid="02a3be78-70b0-422f-81d1-fd3ef5b99878" positionType="Float" x="40" y="0" width="110" height="11" textAdjust="StretchHeight">
- <expression><![CDATA[$F{ShipName} + ", " + $F{ShipCity}]]></expression>
- </element>
- <element kind="textField" uuid="978631ec-a8dd-493e-bbef-b4807e240d4b" x="155" y="0" width="25" height="11" blankWhenNull="true">
- <expression><![CDATA[$F{ShipRegion}]]></expression>
- </element>
- <element kind="textField" uuid="f423ee94-70d7-4b9a-a90d-9c6fefbf6ecd" x="185" y="0" width="50" height="11" pattern="dd/MM/yyyy">
- <expression><![CDATA[$F{OrderDate}]]></expression>
- </element>
- <element kind="textField" uuid="fbb073bd-2aab-4038-acdf-d8791274356d" x="235" y="0" width="35" height="11" pattern="0.00" hTextAlign="Right">
- <expression><![CDATA[$F{Freight}]]></expression>
- </element>
- <element kind="line" uuid="c7f7750f-6d8d-422b-851c-febff2c2bb58" positionType="Float" x="0" y="12" width="270" height="1" forecolor="#808080">
- <pen lineWidth="0.5"/>
- </element>
- </band>
- </detail>
- <columnFooter height="11">
- <element kind="rectangle" uuid="d4156620-50bd-4848-aea6-9941eaa6b2c2" x="0" y="0" width="270" height="11" backcolor="#333333"/>
- <element kind="staticText" uuid="04ad8cd5-334b-47fa-861a-a6c09ed60b0d" mode="Opaque" x="0" y="0" width="45" height="11" forecolor="#FFFFFF" backcolor="#333333" hTextAlign="Right" style="Sans_Bold">
- <text><![CDATA[Count :]]></text>
- </element>
- <element kind="textField" uuid="a71248a9-46f4-43bb-934a-1daaf65c4ed3" mode="Opaque" x="45" y="0" width="25" height="11" forecolor="#FFFFFF" backcolor="#333333" hTextAlign="Right" style="Sans_Bold">
- <expression><![CDATA[$V{COLUMN_COUNT}]]></expression>
- </element>
- <element kind="staticText" uuid="f890a596-b1ed-45d0-92ab-d7810076d5ce" mode="Opaque" x="70" y="0" width="140" height="11" forecolor="#FFFFFF" backcolor="#333333" hTextAlign="Right" style="Sans_Bold">
- <text><![CDATA[Total :]]></text>
- </element>
- <element kind="textField" uuid="cd2a4a6e-ec39-42b5-97da-d39cf4fba351" mode="Opaque" x="210" y="0" width="60" height="11" forecolor="#FFFFFF" backcolor="#333333" pattern="0.00" hTextAlign="Right" style="Sans_Bold">
- <expression><![CDATA[$V{FreightSumColumn}]]></expression>
- </element>
- </columnFooter>
- <pageFooter height="30">
- <element kind="rectangle" uuid="546d4863-ff95-4db9-8607-b1ba97b708fd" mode="Transparent" x="0" y="5" width="555" height="25"/>
- <element kind="staticText" uuid="1eb77597-c859-416d-9d7a-cb0f5a13627e" x="5" y="10" width="50" height="20" fontSize="14.0" hTextAlign="Right">
- <text><![CDATA[Count :]]></text>
- </element>
- <element kind="textField" uuid="74abc4d9-d951-48b9-826c-18c1955ae21b" x="55" y="10" width="45" height="20" fontSize="14.0" hTextAlign="Right">
- <expression><![CDATA[$V{PAGE_COUNT}]]></expression>
- </element>
- <element kind="staticText" uuid="07c3051b-9225-4b07-a092-84ce57bf8cf6" x="430" y="10" width="50" height="20" fontSize="14.0" hTextAlign="Right">
- <text><![CDATA[Total :]]></text>
- </element>
- <element kind="textField" uuid="c54af9f4-b7f4-4ab5-a366-969366845fb4" x="480" y="10" width="70" height="20" fontSize="14.0" pattern="0.00" hTextAlign="Right">
- <expression><![CDATA[$V{FreightSumPage}]]></expression>
- </element>
- <element kind="textField" uuid="6372ffa2-a19d-4be3-bd67-97a937f28ff3" x="200" y="10" width="75" height="20" fontSize="14.0" hTextAlign="Right">
- <expression><![CDATA[$V{PAGE_NUMBER}]]></expression>
- </element>
- <element kind="staticText" uuid="6f87f241-3eeb-4c1a-89a6-b2323bc6b8c9" x="275" y="10" width="5" height="20" fontSize="14.0" hTextAlign="Center">
- <text><![CDATA[/]]></text>
- </element>
- <element kind="textField" uuid="a9701353-2845-4eff-9d71-5f73b4666a44" x="280" y="10" width="75" height="20" fontSize="14.0" evaluationTime="Report">
- <expression><![CDATA[$V{PAGE_NUMBER}]]></expression>
- <property name="net.sf.jasperreports.export.pdf.field.type" value="Text"/>
- <property name="net.sf.jasperreports.print.keep.full.text" value="true"/>
- <propertyExpression name="net.sf.jasperreports.export.pdf.field.name"><![CDATA["PAGENUM"]]></propertyExpression>
- <propertyExpression name="net.sf.jasperreports.export.pdf.field.value"><![CDATA[$V{PAGE_NUMBER} + ""]]></propertyExpression>
- </element>
- </pageFooter>
- </jasperReport>
|