augarte Posted July 20, 2010 Share Posted July 20, 2010 Hi everyone! I want to link the values of some fields with static text. What I want to do is something similar to the following: "Static text before the field " + F{FieldName} + "static text after the field" I have tried it but without success. Did anybody have the same problem? Any solution please? Thanks in advance, Kind regards. Link to comment Share on other sites More sharing options...
augarte Posted July 20, 2010 Author Share Posted July 20, 2010 I was able to do it! I createf a new Text Field and insert this: "This is one variable: " + $F{grp} + ". This is another one "+ $F{MtmRv} + ". An the last one : " + $F{MtmRa}+ " to check how it works depending on the length of each variable"grp, MtmRm and MtmRa are Fields that I have generated from my datasource. Now I have another issue, I want the fields (grp, MtmRm, and MtmRa) to be "bold". Does anybody know how to set the fields as bold (only the values of the fields, not all the text)Thanks in advance!Kind regards,Aitor Link to comment Share on other sites More sharing options...
dnewsom Posted July 20, 2010 Share Posted July 20, 2010 You can set the markup of the text field to HTML so you could put a strong tag around the locations.Code:"This is one variable: <strong>" + $F{grp} + "</strong>. This is another one <strong>"+ $F{MtmRv} + "</strong>. An the last one : <strong>" + $F{MtmRa}+ "</strong> to check how it works depending on the length of each variable" Link to comment Share on other sites More sharing options...
augarte Posted July 21, 2010 Author Share Posted July 21, 2010 Thanks for the reply dnewson. I have tried as you said but it is not working. What I see in my report is the following: "This is one variable: <strong>"value of $F{grp}"</strong>. This is another one <strong>"value of$F{MtmRv}"</strong> And the last one : <strong>"value of $F{MtmRa}"</strong> to check how it works depending on the length of each variableI don't know if it is possible to mix formatting information and data in a textfield. Link to comment Share on other sites More sharing options...
rushit Posted July 21, 2010 Share Posted July 21, 2010 Hey dnewson, Thanx for your solution. It worked perfectly. We just need to set mark up of text field to HTML to make it understand HTML tags. Link to comment Share on other sites More sharing options...
augarte Posted July 21, 2010 Author Share Posted July 21, 2010 Hi rushit, Please, could you tell us how to set mark up of text field to HTML? Thanks,Aitor Link to comment Share on other sites More sharing options...
rushit Posted July 21, 2010 Share Posted July 21, 2010 Hi,In element property list its last but one property.Post Edited by rushit at 07/21/2010 07:48 Link to comment Share on other sites More sharing options...
augarte Posted July 21, 2010 Author Share Posted July 21, 2010 Thanks rushit, but it seems I'm missing something. I've set the markup to html but the fields are not displayed as bold. It seems it undestands the "<strong>" tag but it is not applied. ¿Do I have to use any special encoding? ¿Does the font type have any effect on it? Thanks.Kind regards,Aitor Link to comment Share on other sites More sharing options...
augarte Posted July 21, 2010 Author Share Posted July 21, 2010 Finally I could solve it. I used <b> instead of <strong> and now the JasperPrint is visualized as I want. But still have another problem: when exporting to pdf, the styles are lost. I know I can use a "Pdf Font Name" to set it as bold, but it is be applied to the entire textfield and not only to the values of the fields. I'm afraid there is no chance to achieve what I want. Thanks anyway to dnewson and rushit!!! Kind regards,Aitor 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