[#10106] - JasperLibrary generates different result from JasperStudio

Category:
Bug report
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Minor
Resolution:
No Change Required
Component: Reproducibility:
N/A
Assigned to:
0

When I run report from Jasper Studio it prints the right result, when I run in JasperLibrary in production it doesn't work properly. The bug is a premature breakline in which the text overlap the line below. Looks like only some characters genrate that. I attached some screenshots and the jrxml file and text in database. I tested with static text and it works properly.

AttachmentSize
Image icon pdf generated online42.85 KB
Image icon jasper studio20.51 KB
Image icon image_5.png21.97 KB
Binary Data ocorrencia.jrxml22.92 KB
Plain text icon field.txt1.16 KB
v6.7.0
erickdeoliveiraleal's picture
Joined: Sep 24 2014 - 11:20am
Last seen: 4 weeks 2 hours ago

3 Comments:

#1

verified?

#2

it only happens with justified text

#3
  • Resolution:Open» No Change Required
  • Status:New» Feedback Requested
  • Assigned:nobody» teodord

Hi,

You are not specifying any font for your justified text element. The default font used by the AWT while processing the text and making the Java preview in Studio does not match the metrics of the default font used in the PDF viewer.
You need to use a font extension to make sure the same font is used both in Java and PDF. You can use one of the DejaVu fonts that we ship as an optional font extension and make it the default font of your report by adding this to the JRXML:

<style name="MyDefaultFont" isDefault="true" fontName="DejaVu Sans"/>

I hope this helps.
Teodor

Feedback
randomness