Thursday, January 29, 2009

DataWindow Formatting Tip

This is from Chris Werner in the Sybase newsgroups.  Someone asked if there was a way to improve the formatting of data in a grid datawindow that uses cell borders by forcing a leading or trailing space on the data.  Chris' response:
I'm not sure if it is documented behaviour but sometimes I use a blank in the format of a datawindow column to achieve what you want. For instance for right-aligned number you can use "0 " instead of "0", for left-aligned strings " [general]" works. Of course the will not work if the data is bigger than the column and cut.

Perhaps what stuns me the most is that after many years of PowerBuilder use, I had never tried this.  Great tip.

1 comment:

Jim Reese said...

What a coincidence. Getting back into PB development after a couple of years out, I also just discovered this trick about 2 weeks ago. Never liked right-aligned numbers with grids before, but this takes care of it.