Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How we bold StringBuffer object text?

 
Thakur Sachin Singh
Ranch Hand
Posts: 248
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone tell me, how we bold the text f StringBuffer class object and is there any logic to bold only one word of StringBuffer class object?


Here i want to bold only one word which is sachin, is there any possibility to this? if yes then how and no then how we bold all text of sb1 object?
 
Tim Moores
Bartender
Posts: 2745
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StringBuffer has no concept of formatting. In which context are you displaying the contents of the SB where you want to apply formatting?
 
Thakur Sachin Singh
Ranch Hand
Posts: 248
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i am using jasper report to print the text using valueList[], in whole string i want to apply bold to some words.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does Jasper report support html? If yes, simple <b> tag might work
 
Thakur Sachin Singh
Ranch Hand
Posts: 248
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i am sending the text from action class and this action class is java file, here i can not use html tags.
 
Riaan Nel
Ranch Hand
Posts: 160
IntelliJ IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thakur Sachin Singh wrote:no i am sending the text from action class and this action class is java file, here i can not use html tags.

Thakur, I think that Maneesh means that you should try including a <b> tag within your StringBuffer, like this:


If memory serves me right, Jasper does allow HTML formatting. You just have to set the correct property on the report field.
 
Thakur Sachin Singh
Ranch Hand
Posts: 248
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes but this is not working on the report. html tags print as it is like text and not give any impact on the text.
 
Riaan Nel
Ranch Hand
Posts: 160
IntelliJ IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thakur Sachin Singh wrote:yes but this is not working on the report. html tags print as it is like text and not give any impact on the text.

Re-read the last sentence of my previous response. You need to set a property on your reports element before it will "understand" HTML formatting.
 
Thakur Sachin Singh
Ranch Hand
Posts: 248
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you show me how?
 
Riaan Nel
Ranch Hand
Posts: 160
IntelliJ IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thakur Sachin Singh wrote:can you show me how?

The first hit for "Jasper Reports HTML Markup" on Google
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic