• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Please send solution to this-jasper to pdf problem

Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I am stuck up with a problem in iReport 2.0.0. I need to create a 3-D Bar Chart and export it to pdf but what I face is that when only one row is fetched by the query from the database the bar is as big as the chart itself and if the number of rows fetched from the database increase i.e if the number of bars increase then the size of the bars decrease yet the size of chart remains the same.

Its like having a box when there is only one record, two medium sized bars when two records but when there are multiple records you can barely even see them as lines. All we see them as is a dash of color. If the number of rows per chart is decreased or fixed to some particular number then it shows some thin slices for the bars and the rest of the data is not displayed. So suppose i chose to display 5 bars only those 5 bars as thin as slices so as to accommodate within the chart size are displayed. Rest of the bars vanish and are not even seen on subsequent pages as its the only page that is displayed and basically i don't need it that way.

I need all the bars in one chart for comparison with all having same size constantly irrespective of the size of chart.
I cannot manually change the height or hardcode it because it should depend on the number of entries fetched by the query. so a small chart in case of lesser entries and bigger one to accommodate larger data.

the code for your reference is as follows:

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<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="fromdate" isForPrompting="true" class="java.sql.Timestamp"/>
<parameter name="todate" isForPrompting="true" class="java.sql.Timestamp"/>
<parameter name="companyid" isForPrompting="true" class="java.lang.Integer"/>
<queryString><![CDATA[SELECT account.AccountName, count(contact.Id)
LEFT OUTER JOIN ACCOUNT account on contact.AccountId=account.id
WHERE contact.createddate
BETWEEN $P{fromdate} AND $P{todate}
AND contact.companyid=$P{companyid}
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="Nothing">
<variableExpression><![CDATA[$F{AccountName}==null ? "blank":$F{AccountName}]]></variableExpression>
<band height="0" isSplitAllowed="true" >
<band height="0" isSplitAllowed="true" >
<band height="0" isSplitAllowed="true" >
<band height="0" isSplitAllowed="true" >
<band height="0" isSplitAllowed="true" >
<band height="0" isSplitAllowed="true" >
<band height="0" isSplitAllowed="true" >
<band height="171" isSplitAllowed="true" >
<chart isShowLegend="false" hyperlinkTarget="Self" >
<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>
<dataset resetType="None" >
<itemHyperlink >
<bar3DPlot xOffset="20.0" >
<plot backcolor="#FFFFFF" orientation="Horizontal" labelRotation="3.0" >
<seriesColor seriesOrder="0" color="#FF0000"/>
<seriesColor seriesOrder="1" color="#FF0000"/>
<seriesColor seriesOrder="2" color="#FF0000"/>
<axisFormat tickLabelColor="#000000" axisLineColor="#FFFFFF" >
<axisFormat axisLineColor="#000000" >
<band height="0" isSplitAllowed="true" >


Please help me out.
jenita brown
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also its the same if I export it to any other viewer that is the JR Previewer or anything else.. The output is the same as it is in PDF.

Please help me get rid of this issue.
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic