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

zizul

Members
  • Posts

    4
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by zizul

  1. Yes, I've seen it and tried using different fonts. But when you pointed it out again, it got me thinking and I've found the solution. The problem was with the bold fonts. When I was checking bold option on textfield or using <b> tag with markup option on part of the text in texfield, the problem was occurring. I specified fonts in fonts.xml file like that: <bean id="DejaVuSans" class="net.sf.jasperreports.engine.fonts.SimpleFontFamily"> <property name="name" value="DejaVuSans"/> <property name="normal" value="./fonts/DejaVuSans.ttf"/> <property name="pdfEncoding" value="Identity-H"/> <property name="pdfEmbedded" value="true"/> </bean> As a diagnosed later, I was missing the declaration of bold font: <property name="bold" value="./fonts/DejaVuSans-Bold.ttf"/> Just like it was said in FAQ answer, the JVM must have been silently using some default font for bold, which caused the problem. Anyway, thanks a lot Lucian for the clue. Best regards, Kacper
  2. Hi Lucian . Thanks for the reply. The report is exported to pdf file. Regards, Kacper
  3. Hi. You can pass that field from parent report to subreport as parameter. Than use this parameter in subreport as a datasource filter expression regards, Kacper
  4. Hi. I've got a problem, which I've been struggling with for quite some time now. Finally I've decided to write about it on the forum, since I don't have a clue what to do about it anymore.Hope you could figure somthing out. Problem: There is a textfield with option "Stretch with overflow". It is populated dynamically from datasource objects, passed to the subreport from the main report. A text somtimes is longer than textfield's width so it wraps and streches vertically accordingly. Most of the time it streches correctly, to the number of lines of text. But sometimes it adds extra blank line (space) under the text. Things checked: - text is trimmed (checked for extra whitespaces and new line characters) - text is not ending close to the border of textfield Tried: - changing different fonts, encodings - adding padding to textfield - changing textfield width and height to smaller and bigger (even to 0) - changing Position type and Strech type of the textfield and surrounding elements - changing text alignment - changing jasperreports version - adding different text properties like net.sf.jasperreports.text.truncate.at.char - setting different exporter properties like JRPdfExporterParameter.FORCE_LINEBREAK_POLICY I will post any additional information if needed. Looking forward to any comments and suggestions. Regards, Kacper Code:<?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="subGroupSubreport" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <parameter name="episode" class="pl.psnc.domain.wtc.core.episode.Episode"/> <parameter name="groupSummarySubreport" class="net.sf.jasperreports.engine.JasperReport"/> <parameter name="isInjuryMap" class="java.lang.Boolean"/> <queryString> <![CDATA[]]> </queryString> <field name="shortDisplayName" class="java.lang.String"/> <field name="attributeUIs" class="java.util.Set"/> <field name="attributeOids" class="java.util.Collection"/> <field name="displayIndex" class="java.lang.Integer"/> <sortField name="displayIndex"/> <variable name="date" class="java.lang.String" resetType="None"> <variableExpression><![CDATA[($F{attributeOids}.size() > 0 ? ((String) new ArrayList($P{episode}.getResultsDatesInMilisecondsForAttributes($F{attributeOids})).get(0)) : "")]]></variableExpression> </variable> <variable name="multi" class="java.lang.String"> <variableExpression><![CDATA[($F{attributeOids}.size() > 0 ? ((String) new ArrayList($P{episode}.getResultsMultiNamesForAttributes($F{attributeOids})).get(0)) : "")]]></variableExpression> </variable> <variable name="test" class="java.lang.Integer" incrementType="Column"/> <variable name="dates" class="java.util.List"> <variableExpression><![CDATA[new java.util.ArrayList($P{episode}.getResultsDatesInMilisecondsForAttributes($F{attributeOids}))]]></variableExpression> </variable> <detail> <band height="31" splitType="Stretch"> <frame> <reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="14" width="255" height="17" isRemoveLineWhenBlank="true"/> <box leftPadding="0"> <pen lineWidth="0.0" lineColor="#CCCC00"/> <topPen lineWidth="0.0" lineColor="#CCCC00"/> <leftPen lineWidth="0.0" lineColor="#CCCC00"/> <bottomPen lineWidth="0.0" lineColor="#CCCC00"/> <rightPen lineWidth="0.0" lineColor="#CCCC00"/> </box> <subreport isUsingCache="false"> <reportElement positionType="Float" x="0" y="0" width="255" height="17" isRemoveLineWhenBlank="true"/> <subreportParameter name="episode"> <subreportParameterExpression><![CDATA[$P{episode}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="multi"> <subreportParameterExpression><![CDATA[$V{multi}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="isInjuryMap"> <subreportParameterExpression><![CDATA[new Boolean($P{isInjuryMap}.booleanValue() && $V{REPORT_COUNT}.intValue() == 1)]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="date"> <subreportParameterExpression><![CDATA[$V{date}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{attributeUIs})]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{groupSummarySubreport}]]></subreportExpression> </subreport> </frame> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement positionType="Float" x="0" y="0" width="255" height="14" isRemoveLineWhenBlank="true" forecolor="#5D99B1"> <printWhenExpression><![CDATA[new Boolean(!$P{isInjuryMap}.booleanValue() || ($P{isInjuryMap}.booleanValue() && $V{REPORT_COUNT}.intValue() > 1))]]></printWhenExpression> </reportElement> <box leftPadding="8" rightPadding="15"> <pen lineWidth="0.25" lineColor="#0000CC"/> <topPen lineWidth="0.25" lineColor="#0000CC"/> <leftPen lineWidth="0.25" lineColor="#0000CC"/> <bottomPen lineWidth="0.25" lineColor="#0000CC"/> <rightPen lineWidth="0.25" lineColor="#0000CC"/> </box> <textElement textAlignment="Left"> <font fontName="DejaVuSansMono" size="12" isBold="true" pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{shortDisplayName}.trim().replaceAll("\r","").replaceAll("\n","")]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement positionType="Float" x="0" y="0" width="210" height="14" isRemoveLineWhenBlank="true" forecolor="#5D99B1"> <property name="net.sf.jasperreports.text.truncate.at.char" value="true"/> <property name="net.sf.jasperreports.print.keep.full.text" value="true"/> <printWhenExpression><![CDATA[new Boolean($P{isInjuryMap}.booleanValue() && $V{REPORT_COUNT}.intValue() == 1)]]></printWhenExpression> </reportElement> <box leftPadding="8" rightPadding="15"> <pen lineWidth="0.25" lineColor="#0000CC"/> <topPen lineWidth="0.25" lineColor="#0000CC"/> <leftPen lineWidth="0.25" lineColor="#0000CC"/> <bottomPen lineWidth="0.25" lineColor="#0000CC"/> <rightPen lineWidth="0.25" lineColor="#0000CC"/> </box> <textElement textAlignment="Left"> <font fontName="DejaVuSansMono" size="12" isBold="true" pdfFontName="Helvetica" pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{shortDisplayName}.trim().replaceAll("\r","").replaceAll("\n","")]]></textFieldExpression> </textField> </band> </detail></jasperReport>
×
×
  • Create New...