Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to bold text in middle of a string

Status
Not open for further replies.

szed

Programmer
Jun 25, 2003
55
US
CR10 Oracle 9
I have a text field that is a variable length.
Sometimes it will hold information that I need to bold the middle of it. Here is an example:

sample text >Actions to avoid more sample text

In the above field I need to bold and underline the >Actions to avoid, but leave all the rest of the text alone.

Has anyone done this before?
 
How about showing an actual example. In your sample above, there is nothing to show what ends the sequence you want bolded. Is there some rule that applies?

-LB
 
Here is an example of what the field:
"The team reran the job.
>Actions to Avoid Further Outages
We can't bold Actions to Avoid Further Outages so I use a symbol to see how that would look on
the report."


The only part that I need bold is the verbiage ">Actions to Avoid Further Outages".

The beginning "The team reran the job." and the end
"We can't bold Actions to Avoid Further Outages so I use a symbol to see how that would look on
the report." need to stay the way that they are.

Is that a better explanation?
 
What I am unclear about is how you know where the bolding should end. Is this actually a field or is it a formula?

If it is a field, you have to be able to split out the relevant elements, and then add HTML tags, so we would need to know what identifies the end of the segment, assuming that "<" begins it. In your last sample, it looks like there is a return at the end of the relevant segment, is that always the case?

If it is a formula, then it is simple to add the HTML tags.

-LB
 
Create a formula of:

replace({table.field},">Actions to Avoid Further Outages", "<B>>Actions to Avoid Further Outages</B>")

Use the formula field instead of the field, right click it and select format field->Paragraph->Text Interpretation and select HTML.

-k
 
Sorry for being unclear lbass, the bolding needs to end after the word Outages, that will always be the verbiage that is entered.

Thanks synapsevampire, that was exactly what I needed, it worked!
 
Sorry, I thought you intended the wording you wanted bolded to vary.

-LB
 
No big deal lbass, I wasn't clear enough!!

Anyway, I found this works until the last page of the report, for some reason it is not bolding the last record's detail that contains the verbiage I need bolded, any clue on that one?

Also, is there anyway to incorporate a carriage return before the bolded text in that field?

For example right now I am seeing:
The network team didn't start Actions to avoid further outages The network team will start

And instead I would like to see:

The network team didn't start
Actions to avoid further outages The network team will start

(of course in the above example the 'Actions to avoid further outages' is in bold)

 
Change the formula to:

replace({table.field},">Actions to Avoid Further Outages", chr(13)+"<B>>Actions to Avoid Further Outages</B>")

I don't know of any reason why the formula would not bold on the last record unless you have used a condition "not onlastrecord" in the x+2 formula area for text interpretation.

-LB
 
Thanks lbass, I found the problem, user had spelled outages incorrectly, everything works now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top