2004 IR Help Posted August 21, 2006 Share Posted August 21, 2006 By: Rebecca Peltz - rebecca_peltz Putting a rectangle around elements of report 2005-05-26 15:04 I placed a rectangle around a couple of elements (a static text box,a couple of dynamic text boxes and two subreports). The subreports can grow. The problem is the rectangle cuts into the subreport data - it does not seem to grow with it. I tried setting the Stretch Type to all of it's settings, but none of them made any difference. The code is below: <?xml version="1.0" encoding="UTF-8"?> <!-- Created using an evaluation version of JasperAssistant (http://www.jasperassistant.com) --> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="Unnamed" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30"> <property name="com.jasperassistant.designer.Rulers" value="true"/> <property name="com.jasperassistant.designer.GridWidth" value="5"/> <property name="com.jasperassistant.designer.GridHeight" value="5"/> <property name="com.jasperassistant.designer.DataSource" value="ocean_ongoing"/> <property name="com.jasperassistant.designer.SnapToGrid" value="true"/> <property name="com.jasperassistant.designer.Margins" value="true"/> <property name="com.jasperassistant.designer.Grid" value="true"/> <property name="com.jasperassistant.designer.SnapToGuides" value="true"/> <field name="OriginName" class="java.lang.String"> <fieldDescription><![CDATA[OriginName]]></fieldDescription> </field> <field name="DestinationName" class="java.lang.String"> <fieldDescription><![CDATA[DestinationName]]></fieldDescription> </field> <field name="Currency" class="java.lang.String"> <fieldDescription><![CDATA[Currency]]></fieldDescription> </field> <field name="ItemGUID" class="java.lang.String"> <fieldDescription><![CDATA[itemGUID]]></fieldDescription> </field> <field name="IncludedCharges" class="java.lang.String"> <fieldDescription><![CDATA[includedCharges]]></fieldDescription> </field> <group name="ItemGUID"> <groupExpression><![CDATA[$F{ItemGUID}]]></groupExpression> <groupHeader> <band height="17"> <textField> <reportElement positionType="Float" mode="Opaque" x="0" y="0" width="555" height="16" forecolor="#ffffff" backcolor="#0"/> <textElement verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true" pdfFontName="Times-Bold"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[" " +$F{OriginName} + " -- " + $F{DestinationName}]]></textFieldExpression> </textField> </band> </groupHeader> </group> <detail> <band height="80"> <rectangle> <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="556" height="81"/> <graphicElement/> </rectangle> <textField> <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="156" height="21"/> <box padding="3"/> <textElement> <font fontName="Times New Roman" pdfFontName="Times-Roman"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Currency: " + $F{Currency}]]></textFieldExpression> </textField> <subreport> <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="155" y="0" width="371" height="16" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true"/> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource) $P{REPORT_DATA_SOURCE}).dataSource("/Quote/TransportationItem/TransportationRate[itemGUID=" + $F{ItemGUID} + "]")]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["com/ei/jreports/test/transportation_item_breakset.jasper"]]></subreportExpression> </subreport> <textField isStretchWithOverflow="true"> <reportElement positionType="Float" x="155" y="30" width="371" height="15" isRemoveLineWhenBlank="true"> <printWhenExpression><![CDATA[new Boolean($F{IncludedCharges} !=null)]]></printWhenExpression> </reportElement> <box border="Thin" padding="3"/> <textElement verticalAlignment="Middle"> <font fontName="Times New Roman" size="8" pdfFontName="Times-Roman"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Included Services/Charges: " + $F{IncludedCharges}]]></textFieldExpression> </textField> <subreport> <reportElement positionType="Float" x="215" y="55" width="311" height="17"/> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource) $P{REPORT_DATA_SOURCE}).dataSource("/Quote/TransportationItem/BasicCharges/TransportationItemCharge[itemGUID=" + $F{ItemGUID} + "]")]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["com/ei/jreports/test/basic_charges.jasper"]]></subreportExpression> </subreport> <staticText> <reportElement positionType="Float" x="135" y="55" width="80" height="20"/> <box border="Thin" padding="3"/> <textElement/> <text><![CDATA[ORIGIN ]]></text> </staticText> </band> </detail> </jasperReport> By: Dmitry Beransky - dberansky RE: Putting a rectangle around elements of report 2005-05-26 16:56 can you draw the rectangles inside subreports? By: Rebecca Peltz - rebecca_peltz RE: Putting a rectangle around elements of report 2005-05-27 08:23 The rectangle covers not just the subreport but other elements such as text and static text. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now