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

Is it possible to put chart in one column


abhishek_sh

Recommended Posts

Is it possible to put chart in one column,having 2 columns overall.Genarally if 2 columns are created,whatever printOrder(Horizontaal/Vertical) is selected,data does not confine to one column and fills the column which is for chart only.Can I restrict filling of one column to only column

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

<?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="learn1" language="groovy" columnCount="2" printOrder="Horizontal" pageWidth="1024" pageHeight="768" orientation="Landscape" columnWidth="510" columnSpacing="3" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">

 

 

<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">

<defaultValueExpression><![CDATA["C:\\Documents and Settings\\abhishek_sh\\Desktop\\"]]></defaultValueExpression>

</parameter>

<queryString>

<![CDATA[]]>

</queryString>

<field name="x" class="java.lang.Integer">

<fieldDescription><![CDATA[x]]></fieldDescription>

</field>

<field name="y" class="java.lang.Integer">

<fieldDescription><![CDATA[y]]></fieldDescription>

</field>

<background>

<band splitType="Stretch"/>

</background>

<title>

<band height="79" splitType="Stretch">

<staticText>

<reportElement x="481" y="30" width="100" height="20"/>

<textElement>

<font size="14" isBold="true"/>

</textElement>

<text><![CDATA[sample Report]]></text>

</staticText>

</band>

</title>

<pageHeader>

<band height="35" splitType="Stretch">

<staticText>

<reportElement x="446" y="0" width="100" height="20"/>

<textElement>

<font isBold="true"/>

</textElement>

<text><![CDATA[Page 1]]></text>

</staticText>

</band>

</pageHeader>

<columnHeader>

<band height="100" splitType="Prevent"/>

</columnHeader>

<detail>

<band height="200" splitType="Stretch">

<elementGroup/>

<textField>

<reportElement x="40" y="14" width="100" height="20"/>

<textElement/>

<textFieldExpression class="java.lang.Integer"><![CDATA[$F{x}]]></textFieldExpression>

</textField>

<textField>

<reportElement x="200" y="14" width="100" height="20"/>

<textElement/>

<textFieldExpression class="java.lang.Integer"><![CDATA[$F{y}]]></textFieldExpression>

</textField>

</band>

</detail>

<columnFooter>

<band height="45" splitType="Stretch"/>

</columnFooter>

<pageFooter>

<band height="54" splitType="Stretch">

<textField>

<reportElement x="907" y="13" width="100" height="20"/>

<textElement/>

<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>

</textField>

<textField pattern="MMMMM dd, yyyy">

<reportElement x="74" y="23" width="100" height="20"/>

<textElement/>

<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>

</textField>

</band>

</pageFooter>

<summary>

<band height="42" splitType="Stretch"/>

</summary>

</jasperReport>

 

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

I'm curious to why you don't want to use subreports or why this is imposed to you.

 

In any case, you could use a list component instead of a subreport, to display the values of the first column.

Check the /demo/samples/list sample provided with the JR project distribution package.

 

http://jasperreports.sourceforge.net/sample.reference/list/index.html#list

 

I hope this helps.
Teodor

 

Link to comment
Share on other sites

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...