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

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.

Related

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:

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>

New page shows unwanted indentation in Jasper Reports

I am using Jasper reports to generate a pdf document. The first line of each paragraph is indented. When a paragraph overflows into the next page the first line in the new page is indented, even if it shouldn't be because it is just a continuation from the other page. Here is an example of a paragraph:
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="0" y="60" width="367" height="1">
</reportElement>
<textElement textAlignment="Justified">
<font fontName="Arial" size="12"/>
<paragraph lineSpacing="1_1_2" firstLineIndent="40"/>
</textElement>
<textFieldExpression><![CDATA["This is an extremely long paragraph, so long that it overflows into the next page and gets wrongly indented.\n"]]></textFieldExpression>
</textField>
I know this is not a stack overflow but still it is an overflow problem. Any ideas?
PS: I am desperate, I will consider even the craziest ideas. Sorry, I have no idea why the xml did not keep the readable indented format. It seems that the indent pops up only where you don't want it.

Applying colour to the no records found message

I am working with jasper-reports-4.5.0 and spring 3.0.5RELEASE. I am generating the reports in PDF, HTML, and CSV formats. While generating the reports, if there are no matching records in the database I am displaying the message "No Records Found". How can I make the message appear red?
To set the text to red you just need to set the Forecolor of the text. An example No Data Section with red text would be
<noData>
<band height="20">
<staticText>
<reportElement x="0" y="0" width="555" height="20" forecolor="#FF0000"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[There was no data found.]]></text>
</staticText>
</band>
</noData>
The only caveat to this is that when exporting to csv, obviously the text will not be red since that is just a plain text file. It should work for PDF and HTML though.

different number format in iReport and Jasper Server

i created report in iReport, where is text field with format:
new DecimalFormat("#,##0.00").format($F{NUMBER}) + " €"
In iReport result is 1 234,56 €, which is OK. I am in Slovakia and this is ordinary format here.
In Jasper Server is result 1,234.56 € which is not OK.
Other question: There is still Sk (Slovak Crown) set for Slovakia. Is it possible to set it for EUR ?
Could you help me, what to set where ?
Thanks
If you hard-code the format to use comma for the thousands separator, it's not possible that iReport would ignore this. It sounds like you have not done what you think.
But it seems likely that you need to set the JasperReports Server to use a different locale. You could edit this file:
WEB-INF/applicationContext-security.xml
You'll find the locale section. Add what you need for Slovakia. Then you can choose this locale on the login page.
Or it might be helpful to set the locale in Tomcat's startup script (or whatever app server you are using). These Java parameters might solve your problem (of course you won't want en_US... but those are the parameters):
java -Duser.language=en -Duser.region=US
I have an older version of jasperserver deployed in one of my clients and upgrading it would be a bit of a pain. I'm experiencing the same thing with iReport 4.1.1. My locale is pt_BR and I didn't really want to change my server locale.
I've noticed that iReport is smart (or dumb) enough to not add the class attribute to the textFieldExpression class (I am guessing it guesses from the variable/field type). Jasperserver (at least the version I'm using anyway), on the other hand, does not apply the pattern to numbers if you don't specify the class for that expression.
In other words: iReport generates this markup and renders it as expected:
<textField pattern="###,###,##0.00" isBlankWhenNull="true">
<reportElement mode="Transparent" x="1293" y="0" width="92" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{my_var}]]></textFieldExpression>
</textField>
You can assume that my_var is a BigDecimal. This field does not get rendered correctly in the server, as it simply ignores the pattern (maybe because it assumes all fields are Strings?) unless you specify the expression class for the textFieldExpression:
<textField pattern="###,###,##0.00" isBlankWhenNull="true">
<reportElement mode="Transparent" x="1293" y="0" width="92" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{my_var}]]></textFieldExpression>
</textField>
Note the class="java.math.BigDecimal" in the second last line. It sucks that I had to manually edit the jrxml file, but at least Jasperserver renders my report properly.