In the report item's Column Definition area, there should be a Column Width field. When I tried using it in Apex 4.2, it seemed to have no effect.

There is also an Element width under Column Attributes -- which also had no effect!

http://apex.oracle.com/pls/apex/f?p=21997:2 Dever Ima9Dever

Edited by: Howard (DBA in Training) on Jan 17, 2013 1:26 PM

(more) If you search the forum with "report column field width" you might find about 157 hits. I see lots of folks asking this question but I have yet to find a soution that works for me. You'd think this would be a simple thing -- and if it were the two fields noted above would likely have done the trick.

Complications:
1) If you have a big honking column name like BigHonkingColumnNameWithNoBreaks, you may have to put some breaks (bracket_openBRbracket_close) in it or the column may be forced to this width.
2) Likewise, if your data is a long string XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX then you can have problems because there are no breaks where it can wordwrap.

I haven't helped but there's some info that might prove helpful along the way.

Entering onFocus="javascript:this.maxLength=40;" in the Element Attributes of the column attribute.

Tabular form text items appear to get arbitrary <tt>maxlength="2000"</tt> assigned that cannot be overridden using the column Element Attributes property. This appears to be a situation of long standing: +{message:id=906619}+

I'm trying to understand what it says about a product -- I mean the support for it -- if a long standing problem such as this hasn't been fixed in 7 years?

Okay, I'm not a good one to judge as I haven't used a lot of products. And maybe it's the nature of HTML, CSS, Javascript and XML. But I'd have to warn anyone considering using APEX that they need to be comfortable, and good, with work-arounds. Simple things like this don't work. And other things don't work intuitively. (E.g. Item default values aren't placed in the session state when rendered. Column limits don't.) I think that's a fair assessment.

Howard (DBA in Training) wrote:
Well it does nothing for my report. Maybe it has to match up with something else I'm lacking. ??

Yes, like defining problems precisely enough to understand when you're actually talking about different things?

Robert's issue relates to a text input item in a tabular form (aka "updateable report"), whilst you are talking about a standard report column. Just making a little more effort up front to provide a more detailed definition of the problem will enable members to better understand your situations and avoid confusion.

Howard (DBA in Training) wrote:
As an example, I have a dinky little report with three columns. I'm trying to get it to squeeze the third column (ST_NM) so that it would either truncate or wrap. But no luck.

In recent versions the Column Width property should work. Note that the width is specified in pixels (as described in the online help), not characters as used in Element Width property of form elements. (If you've been trying to set this to Robert's value of "35" it won't have any effect. As the column heading and several of the values are already wider than 35px, and given the defined behaviour of HTML tables and cells is to expand to fit their widest unbroken content, the column will always be rendered wider than 35px.) Try setting it to "90".

Those hundreds of Re: Report column width mainly date from prior to the introduction of the built-in Column Width property, when the standard approach was to specify the width using the CSS Style property:

display: block; width: 300px;

This actually sets the width of the content of the cells in the column. This is not always ideal when working with HTML tables. The best way to set the actual column width is applying a CSS width to the <tt>col</tt>, <tt>th</tt>, or <tt>td</tt> elements directly. The <tt>id/headers</tt> attributes most APEX templates include in report templates are useful as selectors in this case, using one of the page header CSS options:

th[id="COLUMN_ALIAS"],
td[headers="COLUMN_ALIAS"] {
width: 10em;
}

Using one of the CSS techniques is more flexible than the Column Width property as the width can be specified using units other than pixels.

For "big honking" strings that don't contain white space (what is the nature of this data? I keep asking every time this comes up, but no one ever provides an explanation), use <tt>overflow-wrap/word-wrap</tt>: