PeopleTools | Running an SQL statement to set the width for column grids
A. Clunky App Designer
App Designer is not the most elegant tool when it comes to designing the ‘look and feel’ of a page (at least when it comes to the ‘classic’ interface; fluid has improved things greatly here). For instance, you might find yourself with a page grid containing a large number of columns and you’d really like to present each column to the user with the exact same width. Indeed, this particular issue first came up for me when I had to present a grid with twelve monetary columns, one for each month of the year.
If you’re very lucky, you might be able to click and drag each column to the exact same width by using the naked eye alone. Chances are though, the columns will end up having different lengths, which will result in your page having a slightly skewed appearance.
B. Set Column Width
The following SQL will allow you to set the column width automatically for all fields in the grid. In this query, all record fields located in the Level 1 grid will have their column width set to the value of ‘100’. As part of the SQL update below, enter both your page name and Level 1 record name before executing the query:
update pspnlfield set fieldright = 100, fieldsizetype = 2 where pnlname = 'PAGE_NAME' and occurslevel = 1 and recname = 'RECORD_NAME' and fieldname <> ' ';
Note that the ‘fieldsizetype’ value (the second value being updated) indicates the type of column width (0 is average, 1 is maximum, 2 is custom).
You can of course refine this query to only select certain fields, for instance, you may only want to adjust the column width for any field beginning with ‘SF’. Furthermore, if you want to make certain that the above query will update the correct fields, run the query as a ‘select’ first to see which rows will be returned:
select * from pspnlfield where pnlname = 'PAGE_NAME' and occurslevel = 1 and recname = 'RECORD_NAME' and fieldname <> ' ';