Category Archives: WebFOCUS

Custom WebFOCUS Double List Box Control

The double list box control that comes out-of-the-box with WebFOCUS meets most functional requirements. However, in one of my engagements, the double list box control didn’t have all the functionality required. So I took the challenge of creating my own in jQuery so it would be easy to integrate with WebFOCUS.

The additional functionality I added was:

  1. Being able to add more than 1 column to the boxes to provide more context on what was being selected
  2. Sorting of columns
  3. Search specific to only the double list box
  4. Custom sorting of items on the selected items using drag and drop functionality

Unfortunately, I can’t share this code with you, but the following video should give you a sense of what I created.

For those interested in learning more, feel free to reach me at: I will see what I can do for you!

WebFOCUS replace characters in string

Update: As of 8201, there is now a nice simple function called REPLACE. See this link.

A common piece of functionality in most programming languages is a search and replace character function; the more sophisticated languages allow for regular expressions. In any case, here’s how to do a search and replace character in a string using WebFOCUS:


This one was was buried in a forum thread. Note that this is as of WebFOCUS 7.1.3.



WebFOCUS – Showing / Suppressing leading zeroes

WebFOCUS is a rich language that you can do almost anything with. Unfortunately, the depth of the language makes it hard to find how to do certain tasks; I’ve had to search very hard in our documentation, Focal Point, and Google to accomplish what I would consider common tasks.

Here’s an example. When I first started to learn WebFOCUS, I was trying to show the leading zero of a fractional 0 value in a report.

I.e. a zero real value shows up like .00 instead of 0.00.

In most cases that’s fine to save real estate. However, I like it with the leading zero to help with visually aligning decimal places. Simple enough task right? It is, but you have to know the right command and what to search for.

I searched for (always preceding with WebFOCUS):

• Add a zero to a real number in a report

• Suppressing zero values in report (the opposite)

• Formatting numeric values

It took a while (20 minutes), to find what I was looking for. It was:


It’s easy to do, just hard to find how to do it.

This got me thinking; I thought it would be useful to start blogging about various features I’ve found and sharing them with Google. The trick is adding the right keywords to make it easier to find things.

Hopefully, everyone can benefit from this activity. I know I will when a have a mental lapse. 😀

WebFOCUS reports with sparklines – the jQuery approach


This post is going to provide step by step instructions on how to implement sparklines
within WebFOCUS reports using a jquery plugin rather than the standard Information
Builders approach. The major advantage with this technique is it’s quite simple to implement and maintain because of the small code footprint.

Who is this for?

  • Intermediate WebFOCUS knowledge is required
  • Some javascript / jquery knowledge would help but not required if you’re comfortable
    with reading APIs


In most reports, you typically have a column that represents a dimension (a grouping)
and values of measures for that row. Here’s an example:

Additional context that would be useful would be to provide how the measure is doing
over time. This is where sparklines can be used.

Wikipedia’s definition:

A sparkline is a very small line chart, typically drawn without axes or coordinates

Here is an example of a sparkline that shows the trend of a fictitious trading index:

Now I’m going to show you a way to do that with WebFOCUS.


  1. Download the Excel spreadsheet
    and upload it to your WebFOCUS application folder (mine is called sparkline-example)
    by right clicking on the folder, choosing ‘New’->’Upload Data’ and follow the wizard.
  2. This process will create a master file called Sheet1 assuming you choose all default
  3. Download this
    fex file
    and place into your WebFOCUS app folder that you added the Excel spreadsheet
    to. Read the in line comments to understand what’s going on.
  4. Finally, add the js files to your web application folder. You can download the js
    files here.

If you got everything set up properly, it should look like this when you run the
fex file.


The major gotcha is you will not be able to render this WebFOCUS report
as a PDF or do a page print with your browser. I.e. use this technique only if these are not required.