Focal Point
Maintain form - vertical display

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7351058042

August 08, 2007, 10:37 AM
brad-s
Maintain form - vertical display
I have a maintain form wiith a grid.
The values are small (I4) but the column headings are up to 16 characters.

The column heading are in separate edit boxes.

Is there a way to display the contents of an edit box vertically (vs horizontially).


A
ABCD vs B
C
D


Brad S.
WF 8.05 / Win7 /Tomcat Self Serve
August 09, 2007, 08:40 AM
Maintain Wizard
My research on this has shown that in a heading, we can only have the one horizontal line of text. However, if the columns are fixed (no scrolling left / right), I have found two ways to simulate vertical headings.

The first way is with a Text Box. To do this, open Notepad or Word and type the text in one letter at a time, vertically. Copy that text into a text box and align it with the grid column.

The second way is with an HTML Object. Build the value with a br in between each letter. When you display it in the HTML Object, it displays one character per line. You will then need to align that object with the grid.

I am sorry there is no easier way to do this that I have found.

Mark Derwin
August 09, 2007, 10:07 AM
Maintain Wizard
I guess I said this couldn't be done too soon. A lot of trial and error has come up with this solution. It involves two steps. The first is a creation time. The second is at runtime.

Step 1: When you create your grid, edit the text for the desired heading, and place a \n in between each of the characters. In my case, I have: M\na\nr\nk. When you click ok, the heading WILL appear vertically inside the painter. However, at runtime you won't see the vertical heading. You will see the characters with the \n in between them. This does however, increase the height of the grid heading area.

Step 2: Add the following JavaScript to your MNTONLOAD.JS file. This file, that is incorporated into every Maintain application, is run everytime the Maintain form is refreshed.

Form1.Grid1.QuickSetCellTypeEx(2, -1, 2);
Form1.Grid1.QuickSetText(2, -1, "M\na\nr\nk");
Form1.Grid1.SetColWidth(2, 20);
Form1.Grid1.RedrawCell(2, -1);

These commands operate on the heading of column 2. They change the text in the heading to the vertical text and then reduce the width. You Can change the 20 in the SetColWidth statement to make the column as wide as you need. Finally, you may not need the Redraw command, if this is in the OnLoad function.

Good luck - Mark