Jump to content

Recommended Posts

Posted

When using the ScaleFont feature, it scales the font based on the original TextField size. If you are also using StrechType for the Texfield it does not change the font size according to the new size of the TextField.

Is there a way to change the evaluation time so that the ScaleFont sets the font size according to the field size after it's been stretched? 

 

Here is an example, 

Column2 in row 2 should really be a larger font as the TextField is larger.

 

<?xml version="1.0" encoding="UTF-8"?>

<!-- Created with Jaspersoft Studio version 6.19.1.final using JasperReports Library version 6.19.1-867c00bf88cd4d784d404379d6c05e1b419e8a4c  -->

<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="demo_report_scalefont_issue" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="5441e9bf-ef73-4548-975e-0910d3551458">

<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Local LAMDA"/>

<property name="com.jaspersoft.studio.data.sql.tables" value=""/>

<queryString>

<![CDATA[select 1 as column1,

       'James, you are a capable speaker with a calm, confident presenting style. You show strength in your abilities to share anecdotal evidence to support ideas and to draw an audience into your work. You are able to confidently share facts and opinions, and you utilise rhetorical questions and solution with care. Going forward, aim to hone diction skills, and continue to further consider discipline in use of lower body language to complement your presenting style.' as column2

 

UNION ALL

 

select 2 as column1,

       'James, you are a capable speaker with a calm, confident presenting style. You show strength in your abilities to share anecdotal evidence to support ideas and to draw an audience into your work. You are able to confidently share facts and opinions, and you utilise rhetorical questions and solution with care. Going forward, aim to hone diction skills, and continue to further consider discipline in use of lower body language to complement your presenting style.' as column2

 

UNION ALL

 

select 3 as column1,

       'This is a much smaller text ' as column2]]>

</queryString>

<field name="column1" class="java.lang.Long">

<property name="com.jaspersoft.studio.field.name" value="column1"/>

<property name="com.jaspersoft.studio.field.label" value="column1"/>

</field>

<field name="column2" class="java.lang.String">

<property name="com.jaspersoft.studio.field.name" value="column2"/>

<property name="com.jaspersoft.studio.field.label" value="column2"/>

</field>

<title>

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

<staticText>

<reportElement x="10" y="20" width="100" height="30" uuid="c8d7edf9-efe0-4228-b792-6efa8788fd99"/>

<text><![CDATA[sCALEFONT ISSUE ]]></text>

</staticText>

</band>

</title>

<detail>

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

<property name="com.jaspersoft.studio.unit.height" value="px"/>

<textField textAdjust="StretchHeight">

<reportElement x="0" y="0" width="70" height="24" uuid="3ff454d0-25b0-4a4c-9a78-4d814bee60a4">

<property name="com.jaspersoft.studio.unit.height" value="px"/>

</reportElement>

<box>

<pen lineWidth="0.75"/>

</box>

<textElement markup="html"/>

<textFieldExpression><![CDATA[$F{column1}==2?$F{column1}+"<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>":$F{column1}]]></textFieldExpression>

</textField>

<textField textAdjust="ScaleFont">

<reportElement stretchType="RelativeToBandHeight" x="70" y="0" width="490" height="24" uuid="7d710b40-148b-4f85-a99f-f3a2b2e75bd0">

<property name="com.jaspersoft.studio.unit.height" value="px"/>

</reportElement>

<box>

<pen lineWidth="0.75"/>

</box>

<textElement>

<font size="16"/>

</textElement>

<textFieldExpression><![CDATA[$F{column2}]]></textFieldExpression>

</textField>

</band>

</detail>

</jasperReport>

 

  • Replies 1
  • 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...