Jump to content
Changes to the Jaspersoft community edition download ×

Different font in a single text field


2004 IR Help

Recommended Posts

By: MonkeyJoe - monkeyjoe

Different font in a single text field

2004-06-18 11:41

How do I have different font types in a single text field? For example, say a String of "book - <italic>lord of the ring</italic>" where the title of the book is in italic while the String "book" is not. This whole is dynamically generated.

 

Thanks

 

m

 

 

 

 

By: C-Box - c-box

RE: Different font in a single text field

2004-06-18 13:28

look at the "styled text" sample that comes with the latest release of JasperReports (0.5.3) or at JasperReports Homepage (there the sample is also online)

 

hth

C-Box

 

 

 

 

By: MonkeyJoe - monkeyjoe

RE: Different font in a single text field

2004-06-18 15:20

thanks, C-Box.

 

 

 

 

By: MonkeyJoe - monkeyjoe

RE: Different font in a single text field

2004-06-22 12:33

C-Box, thanks again. I digged into it and was able to solve this challenge. But came across another issue. Here is my Textfield expression:

 

$F{Title} + " <style size="8" isItalic="true" pdfFontName="Helvetica-BoldOblique">" + $F{ExternalNote} + "</style>"

 

I got this error when there is a '&' character in the Title field. The value of this particular title field is "Research & Evaluation".

 

[Fatal Error] :1:23: The entity name must immediately follow the '&' in the entity reference.

 

Any advice to over come this?

 

m

 

 

 

 

By: C-Box - c-box

RE: Different font in a single text field

2004-06-22 13:00

Well

 

I remember having read another thread concerning that topic. It's because of the special meaning of the sign "&" within XML-files... when I remember right you have to replace it with "&amp" but I don't know exactly... just search the JasperReports forum for it, I know that the solution is somewhere in a thread.

 

hth

C-Box

 

 

 

 

By: MonkeyJoe - monkeyjoe

RE: Different font in a single text field

2004-06-22 14:44

Thanks again.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...