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,281 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

840 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