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

Textbox is not stretched in crosstab cell


andrey_nado

Recommended Posts

Hi!

I'm working with crosstabs and I have met following problem. My text fields in crosstab cells are using backcolor attribute together with mode="Opaque". I just want to colorize my data cells.

In row header text field may contain long pieces of text which may be wrapped into several lines. Text field is stretched accordingly as well as corresponding crosstab rows.

Now the problem: text fields in data cells are not stretched! I see it because only part of cell is filled by expected color.

Code fragment is attached. Is there any workaround? Is this a bug and should I create issue in bugtracker?

Regards,

Andrey

Code:
<crosstab>	<reportElement x="0" y="0" width="522" height="600"/>	<crosstabParameter name="src" class="com.myproject.DataSource">		<parameterValueExpression><![CDATA[$P{src}]]></parameterValueExpression>	</crosstabParameter>	<crosstabDataset isDataPreSorted="true">		<dataset>			<datasetRun subDataset="dataset1">				<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{src}.getData())]]></dataSourceExpression>			</datasetRun>		</dataset>	</crosstabDataset>	<rowGroup name="orderNo" width="102">		<bucket>			<bucketExpression class="java.lang.Integer"><![CDATA[$F{orderNo}]]></bucketExpression>		</bucket>		<crosstabRowHeader>			<cellContents>				<textField isStretchWithOverflow="true">					<reportElement x="0" y="0" width="102" height="10" />					<textFieldExpression class="java.lang.String"><![CDATA[$P{src}.getEntryName($V{orderNo})]]></textFieldExpression>				</textField>			</cellContents>		</crosstabRowHeader>		<crosstabTotalRowHeader>			<cellContents/>		</crosstabTotalRowHeader>	</rowGroup>	<columnGroup name="field" height="10">		<bucket>			<bucketExpression class="java.lang.String"><![CDATA[$F{field}]]></bucketExpression>		</bucket>		<crosstabColumnHeader>			<cellContents>				<textField>					<reportElement x="0" y="0" width="30" height="10"/>					<textFieldExpression class="java.lang.String"><![CDATA[$V{field}]]></textFieldExpression>				</textField>			</cellContents>		</crosstabColumnHeader>		<crosstabTotalColumnHeader>			<cellContents/>		</crosstabTotalColumnHeader>	</columnGroup>	<measure name="valueMeasure" class="java.lang.Double">		<measureExpression><![CDATA[$F{value}]]></measureExpression>	</measure>	<crosstabCell width="30" height="10">		<cellContents>			<textField pattern="#0.00%" isBlankWhenNull="true">				<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="30" height="10" mode="Opaque" backcolor="#F0F0F0" />				<textFieldExpression class="java.lang.Double"><![CDATA[$V{valueMeasure}]]></textFieldExpression>			</textField>		</cellContents>	</crosstabCell></crosstab>
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

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