Thursday, December 20, 2012

#COLUMN_WIDTH# in Apex report templates

Always check out the original article at for latest comments, fixes and updates.

Even if the topic is no breaking news, there are some references about it in the Apex OTN forum, it may be still worth spending a few words, especially because, up to date (Apex 4.2.1), there is no trace of it in the official Oracle Application Express documentation.

I am talking of the #COLUMN_WIDTH# substitution string which is not mentioned anywhere (neither in the online attribute help, nor in the manuals), even if it is perfectly supported in certain template attributes.

This substitution string is the resulting value of the information you specify in the following places:

snapshot taken from report column attributes page

snapshot taken from report attributes
You won't see the effects of the width set above unless you modify the report templates to include the #COLUMN_WIDTH# substitution string. As this attribute made its way into Apex with version 4.0, if your application is using a report template earlier than Apex 4.0 it won't certainly include it by default, so you need to modify the template as shown in the picture:
snapshot taken from the edit report template page
The substitution string will result in an HTML code fragment like the following: style="width:64px" (the actual value comes from the example above).
Note that #COLUMN_WIDTH# is also accepted in the Column Template Attributes numbered 1-4, not only in the column headings however bear in mind that it can make sense to specify it here only if you omit the headings altogether otherwise it will be most likely ignored by the browser in virtue of the algorithm used to calculate the column width.

I also updated the substitution string cross reference chart I wrote several years ago to reflect the new situation, in case someone stumbles upon it for the first time.

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