How to change font??

0

I have many reports in my project. I need to change the font that is displayed in the report. My .jrxml files contain about 20000 lines. It is difficult for me to change <font> tag for text element in all the .jrxml files. Is there a way that i can change the font of my reports without changing the .jrxml files??

I tried to use setFont() method on JasperViewer object. But it didnot work.

anila's picture
9
Joined: Dec 3 2008 - 9:26pm
Last seen: 11 years 4 days ago

2 Answers:

0

What about a small Java app that:

  1. load all your designs,
  2. parses each JasperDesign Object,
  3. create a new Style with your wanted font
  4. set this new Style to all textelements
  5. save the JasperDesign to JRXML

 

so you could later change the font again with just ONE statement for each JasperDesign

The best thing would be a external Style - but as I've never done this before, I can't give you a hint, but perhaps anyone else!??  :-)

 

hth

C-Box

C-Box's picture
2250
Joined: Jul 19 2006 - 5:58pm
Last seen: 6 days 15 hours ago
0

External styles can indeed be used to keep in a single location style information that applies to multiple reports.

JasperReports includes under demo/samples/templates a sample report that illustrates how to use external styles.

Regards,

Lucian

lucianc's picture
7156
Joined: Jul 17 2006 - 1:10am
Last seen: 18 hours 21 min ago
Feedback