Solved

How to create a report using iReport, set bold for some words in TextField and exports to PDF using jasper reports?

Posted on 2010-08-20
6
4,246 Views
Last Modified: 2013-12-15
Hello,

I'm using iReport 3.5.2, jasperreports-3.5.2.jar, iText-2.1.0.jar in my application. When I'm using the iReport, the report shows ok, with bold in some words. But when I'm exporting to PDF in my application, the words appear without bold.

What's the problem?

I'm sending the report attached.

Thanks a lot.  Ato028.txt
0
Comment
Question by:arthur_info
  • 4
6 Comments
 
LVL 6

Expert Comment

by:__geof__
ID: 33509237
How do you export to PDF, it is probably the cause of the error.
0
 
LVL 1

Author Comment

by:arthur_info
ID: 33509910
Well... It's a big routine... It's attached in 2 files, the "Report.zip" that has the routine to generate the report and "Source.zip" that it's a sample of use of the jar created by "Report.zip". But searching here I think that is missing some library... Somebody knows something about this?

Thanks a lot...
Source.zip
report.zip
0
 
LVL 13

Expert Comment

by:Murali Murugesan
ID: 33538781
check the following,

1. IText version used by ireport and your application.
2. Check whether the font you apply for PDF export is reflected correctly from your application.

-Murali*

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:arthur_info
ID: 33557626
iText: 2.1.0. The fonts are correct, I think. I'm sending the screens attached.

Thanks...
Library.jpg
0
 
LVL 1

Author Comment

by:arthur_info
ID: 33557640
Sending other printscreens...
Designer.jpg
Preview.jpg
0
 
LVL 1

Accepted Solution

by:
arthur_info earned 0 total points
ID: 33567113
I discovered the answer...

I need to put "<style isBold=\"true\" fontSize=\"12\" pdfFontName=\"Helvetica-Bold\">$F{FIELD}</style>"

and not "<style isBold=\"true\" fontSize=\"12\"\">$F{FIELD}</style>

This way works fine.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question