Wednesday, December 06, 2006

Highlighting woes

If you are hitting your head against the wall, as i did, wondering why you can't get a word highlighted in a report, then, you may have come to the bottom line of your problem.
Or so i hope for you.

So, if you already excluded the following issues...

1. case sensitivity problems
2. missing template definitions
3. multiple word highlighting
4. column defined as a link

Then you can probably check out if you put anything in the usually empty "HTML Expression" attribute.

This attribute allows you to greatly customize the content of the "cell", however, if you do so, you completely loose the possibility of using word highlighting.

As it was in my case.

It's not really a quirk of Oracle Application Express, but it's missing information in the online help, because it would have helped greatly if they just put a note saying "does not work when HTML Expression is not empty".

So, if you still want to highlight your stuff, you must do it the hard way:
By replacing or regexp_replacing in case you want it to work for multiple words:

select regexp_replace('oracle application express', '(oracle|express)', '<b>\1</b>') newstr from dual

<b>oracle</b> application <b>express</b>

I hope you can figure out easily how to convert this example into a working parameterized solution.

Happy highlighting

Updated April 10:
you can now use Yocoya's on-line Regular Expression Workbench for Oracle for developing and testing regular expression patterns.

No comments:

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles