IReport .jrxml font url to parameter [duplicate] - jasper-reports

This question already has answers here:
Font extensions does not work for JasperReports
(3 answers)
When export a report to PDF change the font
(6 answers)
Use custom fonts when creating pdf using iReport
(4 answers)
Closed 10 months ago.
Basically, I want to change the font name URL from the parameters.
I tried to do it like $P{FONT_PATH} inside the url.
<paramter name="FONT_PATH" class="java.lang.String"/>
<testElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial Unicode MS" size="8" isBold="false" pdfFontName="/resources/fonts/ARIALUNI.TFF"/>
</testElement>

Related

Bullets not print in pdf which generated by jasper report but preview correctly in jasper soft studio [duplicate]

This question already has answers here:
Jasper Reports PDF doesn't export cyrillic values
(1 answer)
How can I display "$£Ω€απ⅔" in Jasperserver PDF using iReport?
(2 answers)
Closed 3 years ago.
I am designing a jasper report using jasper (6.1.0) soft studio and jasper report is exported to pdf . Every static text on the report correctly display on pdf .
But bullets(Black squires in the code below ) are not in pdf.
I tried to change the encoding and I tried with font extension as well.
<staticText>
<reportElement positionType="Float" mode="Opaque" x="1" y="221" width="553" height="39" isRemoveLineWhenBlank="true" uuid="4b31d8f1-d37b-4976-87ac-8d8b90d73ee8"/>
<textElement textAlignment="Justified" verticalAlignment="Top" markup="none">
<font fontName="Allianz Sans" isBold="true"/>
</textElement>
<text>
<![CDATA[
◼ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
◼ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
◼ cccccccccccccccccccccccccccccc
]]>
</text>
</staticText>
I expected to print pdf (with bullets (black squires))
◼ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
◼ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
◼ cccccccccccccccccccccccccccccc
But result as follow (without bullets (black squires))
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccccccc
Need a help to find out a reason for this or any solution.

Bengali unicode rendering problem during generating pdf from Jasper Studio (TIBCO Jaspersoft Studio) [duplicate]

This question already has answers here:
How can I render hindi correctly when exporting to pdf?
(4 answers)
How can I display "$£Ω€απ⅔" in Jasperserver PDF using iReport?
(2 answers)
How can I test if my font is rendered correctly in pdf?
(1 answer)
Jasper Reports PDF doesn't export cyrillic values
(1 answer)
How to export fonts in Gujarati-Indian Language to pdf?
(2 answers)
Closed 4 years ago.
I am trying to create pdf in Bengali language using jasper studio (TIBCO Jaspersoft® Studio 6.6.0 in Ubuntu 16.04)
Below is My Jrxml properties and style:
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
<property name="net.sf.jasperreports.awt.ignore.missing.font" value="true"/>
<property name="net.sf.jasperreports.default.pdf.encoding" value="Identity-H"/>
<style name="Base" isDefault="true" fontName="SolaimanLipi" fontSize="18" pdfFontName="/home/shaon/Downloads/SolaimanLipi_20-04-07.ttf" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
This is showing correct preview in jasper studio:
But when I export pdf, bengali font gets distorted:
What am I doing wrong here? Any suggestion ?

Jasperreports Indent after the first line [duplicate]

This question already has answers here:
How to add indentation on bullet list?
(2 answers)
Indentation in generated PDF using JasperReports
(1 answer)
Closed 4 years ago.
I am producing reports with jasper 6.6.0 in PDF and docx.
The problem that I am facing is that I can not have a paragraph indention after the first line. The input text is a paragraph separated by new lines from a XML file:
<Literatur>Bjelland, EK; Wilkosz, P; Tanbo, TG; Eskild, A (2014). Is unilateral oophorectomy associated with age at menopause? A population study (the HUNT2 Survey). Human Reproduction 29(4): 835-41. DOI: 10.1093/humrep/deu026
Leitlinienprogramm Onkologie (AWMF, Deutsche Krebsgesellschaft, Deutsche Krebshilfe) (2012): S3-Leitlinie Diagnostik, Therapie und Nachsorge des Mammakarzinoms, Langversion 3.0, 2012, AWMF-Registernummer: 032/045OL, http://leitlinienprogramm-onkologie.de/Mammakarzinom.67.0.html (Recherchedatum: 15.10.2015). Stand: Juli 2012, gültig bis 30.06.2017.
</Literatur>
I add and put each line between and then the following style:
<style name="indent" style="Standard">
<box leftPadding="5"/>
<paragraph firstLineIndent="-5"/>
</style>
Using in text field:
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="indent" positionType="Float" x="0" y="159" width="465" height="28" uuid="f7184f30-82ee-44b4-8dcb-9d3d70ac3bc8"/>
<textFieldExpression><![CDATA[$F{Literatur}]]></textFieldExpression>
</textField>
as has been posted in Indentation in generated PDF using JasperReports but this mad the literatur part to vanish and not showing at all.
How can I produce export in PDF and docx just like my java export?
DOCX looks like:
PDF looks like:
Java export which is correct:

Jasper Report truncates text before filling the whole text field

I'm having a problem with my PDF report where a String in a text field is truncated before filling the text field. The amount of missing characters (5-6) would not be enough to go over the end of the textField.
I added the text.truncate.at.char property to the report element but the String is still truncated (after displaying some more characters than before).
I also checked if there are other report elements blocking the end of the text field, but there are none.
Lastly I tried a potential fix I found and added "\n" to the end of the line, but that also did not help.
In iReport Designer the whole String is displayed.
PDF report
iReport Designer Preview
Does anyone know how to make Jasper Reports use the whole space in the text field?
PS: Allowing the text to overflow to the next line is not possible due to customer wishes.
I'm using Jasper Reports 5.5.2.
Edit:
The textField is part of a detail band in a subreport. I'm not allowed to share the whole .jrxml, but this is the code for the textField:
<textField>
<reportElement style="Unicode" mode="Opaque" x="0" y="2" width="467" height="17" forecolor="#FFFFFF" backcolor="#00007F" uuid="e810d7a4-6802-4620-af2f-4c385a9e80a6">
<property name="net.sf.jasperreports.text.truncate.at.char" value="true"/>
</reportElement>
<textElement verticalAlignment="Middle" markup="none">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[" More Details - "+$F{Description} + " ("+$F{Id}+")"]]></textFieldExpression>
</textField>
The description is of variable length, the Id is a GUID. In this case there should still be more than enough space in the textField to display the whole GUID.
Here is another screenshot with isStretchWithOverflow="true":
The text is now displayed completely in the first line but the textField is larger which is not accepted by the customer.
Why is it different in pdf and iReport designer?
This is because iText (the library creating your pdf) is doing its "best effort" to render the font you have indicated in jrxml and its not good enough (it is using another font that is bigger...).
To avoid these problems you need to use font extensions and check your settings on style and textElement
Checklist to rendered font correctly in pdf
How to add font extension using iReport
OP solved as in comment:
Font extension installed, removing isBold="true" on textElement, since the style set to textElement had isBold="false"

UNWANTED PAGE BREAK WHEN THE REPORT_COUNT IS ONLY 1 JASPER REPORT [duplicate]

This question already has answers here:
How to control the number of rows in a JasperReports
(2 answers)
Closed 4 years ago.
Hi I have a subreport with a page break, how do I limit the printing of the page break when just REPORT_COUNT > 1?
<break>
<reportElement x="0" y="8" width="100" height="1">
<printWhenExpression><![CDATA[$V{REPORT_COUNT}>1]]></printWhenExpression>
</reportElement>
</break>