Board index » jbuilder » JdbTable column width

JdbTable column width


2006-04-13 05:35:12 PM
jbuilder18
Hi,
I have a JdbTable that shows a QueryDataSet result ( it's about few
hundreds rows in 7 columns). The problem is, that the shown values (from
my database) are usually VARCHARs.
Is there any function that allows me to set the concrete column width as
the max length from all rows of column[i] and column[i] caption?
Thanks,
Michael Aresti
 
 

Re:JdbTable column width

Michael Aresti wrote:
Quote
I have a JdbTable that shows a QueryDataSet result ( it's about few
hundreds rows in 7 columns). The problem is, that the shown values (from
my database) are usually VARCHARs.

Is there any function that allows me to set the concrete column width as
the max length from all rows of column[i] and column[i] caption?
The com.borland.dx.dataset.Column setWidth() method is what JdbTable
actually uses to determine column widths. You can fiddle with this method
to force the size, but I would recommend against iterating through your
entire data set just to determine the maximum length.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

Re:JdbTable column width

Kevin Dean [TeamB] napisa?a):
Quote
The com.borland.dx.dataset.Column setWidth()method is what JdbTable
actually uses to determine column widths. You can fiddle with this
method to force the size, but I would recommend against iterating
through your entire data set just to determine the maximum length.
It's not what I'm looking for. For example in my MySql database in one
table I have a column "Information" witch VARCHAR(255).
This column usually contains STRINGs up to 50 characters (but my boss
wants to save it as VARCHAR(255) because some informations can be much
longer).
So it can happens that in the table is only one row with max length 255
characters or there is none - setWidth() for the maximum length is not a
solution.
My program should be flexible - when there is no data with 255
characters the column width in the table should be set for the long of
the "biggest-longest" inscription in the database column "Information.
PS.:
I tried iterating through the whole data set - sometimes it works too slow;)
 

{smallsort}