2005 IR Help Posted August 26, 2006 Share Posted August 26, 2006 By: daniel - daniel_tche bold in a part of a field 2004-04-30 10:57 I have a string field and I would like to have a part of this string in bold. Problem is: the bold part is in a variable position. What could I do !? Thanks in advance. Link to comment Share on other sites More sharing options...
migueldealmeida Posted April 15, 2011 Share Posted April 15, 2011 I have the same doubt. Did you manage to know the answer? Link to comment Share on other sites More sharing options...
mdrg Posted April 15, 2011 Share Posted April 15, 2011 Set the text field markup to "styled" and use <style isBold="true"></style> around the text you wish to be bold.Where to put this tag is up to you, according to your requirements and needs. You probably can do it easily with String manipulation methods, as long as you can locate the text you want to be bold. I suggest you do this on a Scriptet, so you can use all of Java String manipulation methods and classes.Post Edited by mdrg at 04/15/2011 11:51 Link to comment Share on other sites More sharing options...
migueldealmeida Posted April 15, 2011 Share Posted April 15, 2011 mdrg, thanks in advance for your reply.I'm not sure if I understand it entirely. Should it work if one puts the tag in the expression? I'm not sure how to fit it there, could you help from this example:expression: <style isBold="true">"WWUID: "</style> + $F{worldwideUID.wwuid} With that iReport says there is a parsing error in "<", so it's probably not like this... Link to comment Share on other sites More sharing options...
patobarrientos Posted April 15, 2011 Share Posted April 15, 2011 Daniel & Oscar ... this is how to put it in the Text Field Expression:"<style isBold=\"true\">"+$F{FieldName}+"</style>" check the \ (backslash) before any "(quote) when setting the value to true, because the whole line should be a String.I hope it works now.Regards Link to comment Share on other sites More sharing options...
patobarrientos Posted April 15, 2011 Share Posted April 15, 2011 I think that for your case is:"<style isBold="true">"+WWUID: +"</style>" + $F{worldwideUID.wwuid}Post Edited by patobarrientos at 04/15/2011 13:47 Link to comment Share on other sites More sharing options...
migueldealmeida Posted April 15, 2011 Share Posted April 15, 2011 Many thanks patobarrientos. That's it! However, the style is only applied in pdf and word/writer, not in spreadsheet. Link to comment Share on other sites More sharing options...
patobarrientos Posted April 15, 2011 Share Posted April 15, 2011 I checked it working on Excel and it works good.I'm printing from a Java code using JRXlsExporter class. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now