Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 13th, 2007, 06:20 AM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems generating Charts with iReport2.0.0

Hi Friends,
I'm facing this problem while using Charts of iReport2.0.0. After the usual reports I needed to make Charts and I chose the option of Bar 3-D charts and drew the chart in LastPageFooter.The chart gets its data from the query which fetches the desired fields. I am using MySql3.0 for the database. The output was that the bars are very very thin and I need to increase the thickness of these Bars and increase or decrease the distance between two consecutive bars as per requirements. What do I do that changes the thickness of the bars and also the distance between the bars?

Kindly Help.

Following is the code in case you would need it.

------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
         name="ActiveContact"
         columnCount="1"
         printOrder="Vertical"
         orientation="Portrait"
         pageWidth="520"
         pageHeight="842"
         columnWidth="460"
         columnSpacing="0"
         leftMargin="30"
         rightMargin="30"
         topMargin="20"
         bottomMargin="20"
         whenNoDataType="NoPages"
         isTitleNewPage="false"
         isSummaryNewPage="false">
    <property name="ireport.scriptlethandling" value="0" />
    <property name="ireport.encoding" value="UTF-8" />
    <import value="java.util.*" />
    <import value="net.sf.jasperreports.engine.*" />
    <import value="net.sf.jasperreports.engine.data.*" />

    <parameter name="companyid" isForPrompting="true" class="java.lang.Integer"/>
    <queryString><![CDATA[SELECT account.AccountName,count(contact.Id)
FROM CONTACT contact
LEFT OUTER JOIN ACCOUNT account on contact.AccountId=account.id
WHERE
contact.active=1
AND contact.companyid=4
GROUP BY account.AccountName
ORDER BY account.AccountName]]></queryString>

    <field name="AccountName" class="java.lang.String"/>
    <field name="count(contact.Id)" class="java.lang.Long"/>

    <variable name="AccName" class="java.lang.String" resetType="Report" calculation="Count">
        <variableExpression><![CDATA[$F{AccountName}==null ? "blank":$F{AccountName}]]></variableExpression>
    </variable>
        <background>
            <band height="0" isSplitAllowed="true" >
            </band>
        </background>
        <title>
            <band height="0" isSplitAllowed="true" >
            </band>
        </title>
        <pageHeader>
            <band height="0" isSplitAllowed="true" >
            </band>
        </pageHeader>
        <columnHeader>
            <band height="0" isSplitAllowed="true" >
            </band>
        </columnHeader>
        <detail>
            <band height="0" isSplitAllowed="true" >
            </band>
        </detail>
        <columnFooter>
            <band height="0" isSplitAllowed="true" >
            </band>
        </columnFooter>
        <pageFooter>
            <band height="0" isSplitAllowed="true" >
            </band>
        </pageFooter>
        <lastPageFooter>
            <band height="171" isSplitAllowed="true" >
                <bar3DChart>
                    <chart isShowLegend="false" hyperlinkTarget="Self" >
                    <reportElement
                        mode="Opaque"
                        x="69"
                        y="0"
                        width="308"
                        height="171"
                        key="element-1"/>
                    <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
                        <chartTitle color="#000000" >
                                <titleExpression><![CDATA["Active Contact"]]></titleExpression>
                    </chartTitle>
                    </chart>
                    <categoryDataset>
                        <dataset >
                        </dataset>
                        <categorySeries>
                            <seriesExpression><![CDATA[$V{AccName}]]></seriesExpression>
                            <categoryExpression><![CDATA[$V{AccName}]]></categoryExpression>
                            <valueExpression><![CDATA[$F{count(contact.Id)}]]></valueExpression>
                <itemHyperlink >
                </itemHyperlink>
                        </categorySeries>
                    </categoryDataset>
                    <bar3DPlot xOffset="20.0" >
                        <plot backcolor="#FFFFFF" orientation="Horizontal" labelRotation="325.0" >
                            <seriesColor seriesOrder="0" color="#FF0000"/>
                            <seriesColor seriesOrder="1" color="#FF0000"/>
                            <seriesColor seriesOrder="2" color="#FF0000"/>
</plot>
                        <categoryAxisFormat>
                            <axisFormat tickLabelColor="#000000" axisLineColor="#FFFFFF" >
                            </axisFormat>
                        </categoryAxisFormat>
                        <valueAxisFormat>
                            <axisFormat axisLineColor="#000000" >
                            </axisFormat>
                        </valueAxisFormat>
                    </bar3DPlot>
                </bar3DChart>
            </band>
        </lastPageFooter>
        <summary>
            <band height="0" isSplitAllowed="true" >
            </band>
        </summary>
</jasperReport>

------------------------------------------------------------------------------
Thanks and Regards,

Jenal








Similar Threads
Thread Thread Starter Forum Replies Last Post
charts MunishBhatia ASP.NET 2.0 Professional 0 May 28th, 2007 11:52 AM
about charts MunishBhatia ASP.NET 2.0 Professional 1 May 11th, 2007 05:40 AM
Problems While generating pdf using Jasper kiran_p2p J2EE 0 December 27th, 2006 12:04 AM
Generating Charts with VBA davidimurray Excel VBA 5 September 21st, 2006 08:04 AM
charts s_gh Excel VBA 1 May 31st, 2006 09:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.