BestFit Question |
Post Reply |
Author | |
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
Posted: 06 March 2007 at 1:08pm |
I am running the following function to set all columns to bestfit + 15
Public Sub AdjustAllColumns(rpt As ReportControl) Dim i As Long For i = 0 To rpt.Columns.count - 1 If rpt.Columns(i).Resizable = True Then rpt.Columns(i).BestFit rpt.Columns(i).Width = rpt.Columns(i).Width + 15 End If Next i End Sub However, I am still not getting the BestFit. I tried to upload a screenshot but I can't get it to work. So, what's happening is that the column headers are fine but the contents of the items in the columns that are not wide enough are cut off with ... Any ideas? |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Have you disabled AutoColumnSizing property before calling this method?
-- WBR, Serge |
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
AutoColumnSizing is set to false after the columns are created. Also the property in the property page is false. It is never being set to True.
|
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
Nothing new here?
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Nothing new because can not reproduce the problem.
Adjusting width with BestFit looks to be working fine. Your procedure also works fine. ... May be the problem is that some columns you created without their own permissions to be resized, like a one below:
-- WBR, Serge |
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
Recreate:
In the ReportSample: frmTaskList_Load change the width of the Subject column to 10 Either before or after calling .Populate in frmTaskList_Load add the following line: Call AdjustAllColumns Add the following procedure to frmTaskList Public Sub AdjustAllColumns(rpt As ReportControl) Dim I As Long For I = 0 To rpt.Columns.Count - 1 If rpt.Columns(I).Resizable = True Then rpt.Columns(I).BestFit rpt.Columns(I).Width = rpt.Columns(I).Width + 15 End If Next I End Sub Shouldn't all of the data in the Subject column be visible? VB6 with CJ 10.4.2 |
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
Has CJ recreated this?
|
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
Hello?
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
Hello jcollier
have you called your method after .populate?
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.3
Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6 |
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
Yes, to no avail.
|
|
Fabian
Senior Member Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336 |
Post Options
Thanks(0)
|
Hello jcollier
I forgot to mention that the BestFit method in my code only works as follows:
Hope that helps
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.3
Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6 |
|
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
|
On first glance that seems to be working! I'll have to check it out more later but it appears to have fixed the problem. Thanks!
The function now looks as follows: Public Sub AdjustAllColumns(rpt As ReportControl) Dim I As Long rpt.Redraw For I = 0 To rpt.Columns.Count - 1 If rpt.Columns(I).Resizable = True Then rpt.Columns(I).BestFit rpt.Columns(I).Width = rpt.Columns(I).Width + 15 End If Next I End Sub |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |