Saturday, October 03, 2009

Adjusting the Plus Font Size

There is a known Java bug that causes a worksheet's results to display in a different font in Plus and Viewer. This posting will explain how, for most instances anyway, to rectify this situation.

If you create a workbook in Plus and then open the same workbook in Viewer you may have noticed that the font size in Viewer is bigger than the one in Plus. This can be very annoying and what I have seen happening with many report writers reduce the font size in Plus to something which is very hard to read like size 9. However, when the same workbook is opened in Viewer this same workbook displays in what looks like size 12.

As I say, this is a known bug and there is a fix. Let me show you with example screenshots from my own system. First of all, here is the output from Plus without the fix:

And here is the same report in Viewer. Notice how the font in Plus is smaller?

Ok, now let's equalize the fonts so that Plus displays in the same size as Viewer. You need to edit the pref.txt in the Oracle home for your middle tier. You will find it at this location:

$ORACLE_HOME\Discoverer\util, which in my case was here: c:\oracle\bihome1\discoverer\util

With me so far? I will continue.

You edit this file and look for the entry called AdjustPlusFontSize (with the first letter of each word capitalized and no spaces between the wrods). The entry in most systems will look like this: AdjustPlusFontSize = "false" with the following additional instructions:

# false - Do not adjust the font size to workaround the java bug, 1 Adjust the font size

The instructions are wrong.

The setting you need to apply to fix this is "true" not 1. By the way, if you have my Oracle Discoverer 10g Handbook, take a look at page 791. It gives the correct entries of false (to not adjust the size) and true (to adjust the size). The entry needs to be in double quotes as shown above.

After you save the pref.txt you will need to apply your preferences by executing (if running on Linux or Unix) or running applyprefences.bat (if running on Windows). The applyprefences file can be found in the same folder where pref.txt resides. A sort of one stop shopping.

Having changed and applied your preferences you need to stop and restart the Discoverer middle tier. On my system, after I did this I reran the report and got the following output:

Take a close look at where the report ends when compared to the menu bar above and now go and compare this with the compare the output that I gave earlier in the posting. As you can see, the Plus font has indeed got bigger. In actual fact, it is now displaying the same as it does in Viewer. With this fix done, your report writers can now focus on Plus when creating reports rather than having to reduce the Plus font manually to accommodate Viewer.

Bottom line: the fault is not with Viewer but with Plus not displaying fonts correctly. Oracle have stated that this is due to a Java bug. By the way, the bug, if it actually is a bug and not just an unwanted feature, still resides in the latest Sun Java 1.6 so I advise you to make this change no matter what version of Java you are running.

By the way, unlike some preferences when this one is changed it affects all workbooks not just new ones. What it does is make them display in the correct font in Plus, the same as the way it displays in Viewer. You may have noticed that in Viewer the same workbook seems to take up more space. The reality is that in Viewer the fonts display in the right size whereas in Plus they appear smaller than in other Windows applications such as Word, Excel and so on. This fix makes Discoverer Plus right in tune with other applications.

No comments: