Jump to content
We've recently updated our Privacy Statement, available here ×

Unwanted chart expansion


chrisjones9

Recommended Posts

Absolute Jasper Studio beginner here, so I'm sure this is very obvious, but tearing my hair out. I'd like to create a main report with two small charts side-by-side. (For testing purposes the charts are identical.)

In preview my subform appears correctly as a small 180x180 chart, but my main report is two large, overlapping charts that take up most of an A4 page. How do I stop the charts both expanding to take the entire width of my main report ?  I've played around with all the stretchType settings etc I can think of, but nothing changes. (Except that sometimes Jasper Studio creates hundreds and thousands of blank pages in preview.)

Any advice gratefully received.

-----

My subreport contains the chart specified as:

                <chart evaluationTime="Report">
                    <reportElement stretchType="ElementGroupHeight" x="0" y="0" width="180" height="180" uuid="[uUID]"/>
                    <chartTitle/>
                    <chartSubtitle/>
                    <chartLegend/>
                </chart>

----------

My main report is

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1  -->
<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="Main3" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0f906fd0-f411-4581-97ae-910a093508e3">
    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Tosca"/>
    <queryString language="SQL">
        <![CDATA[select * from table]]>
    </queryString>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="50"/>
    </title>
    <summary>
        <band height="300" splitType="Stretch">
            <subreport overflowType="Stretch">
                <reportElement x="0" y="0" width="210" height="210" uuid="[uUID]"/>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA["SubReport1.jasper"]]></subreportExpression>
            </subreport>
            <subreport overflowType="Stretch">
                <reportElement x="220" y="0" width="210" height="210" uuid="[uUID]"/>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA["SubReport1.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </summary>
</jasperReport>

 

 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...