 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Michael Aresti Guest
|
Posted: Thu Apr 13, 2006 10:03 am Post subject: JdbTable column width |
|
|
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 |
|
| Back to top |
|
 |
Kevin Dean [TeamB] Guest
|
Posted: Thu Apr 13, 2006 5:03 pm Post subject: 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.
http://www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html |
|
| Back to top |
|
 |
Michael Aresti Guest
|
Posted: Thu Apr 13, 2006 8:03 pm Post subject: 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;) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|