Print Page | Close Window

BestFit Question

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=6573
Printed Date: 13 November 2024 at 11:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: BestFit Question
Posted By: jcollier
Subject: BestFit Question
Date 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?





Replies:
Posted By: sserge
Date Posted: 06 March 2007 at 5:49pm
Have you disabled AutoColumnSizing property before calling this method?

--
WBR,
Serge


Posted By: jcollier
Date Posted: 07 March 2007 at 11:46am
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.


Posted By: jcollier
Date Posted: 14 March 2007 at 2:57pm
Nothing new here?


Posted By: sserge
Date Posted: 22 March 2007 at 6:40pm
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:

Set Column = wndReportControl.Columns.Add(COLUMN_ICON, "Message Class", 18, False)


--
WBR,
Serge




Posted By: jcollier
Date Posted: 26 March 2007 at 2:04pm
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


Posted By: jcollier
Date Posted: 03 April 2007 at 10:01am
Has CJ recreated this?


Posted By: jcollier
Date Posted: 03 May 2007 at 12:21pm
Hello?


Posted By: Fabian
Date Posted: 04 May 2007 at 11:21am
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


Posted By: jcollier
Date Posted: 04 May 2007 at 4:41pm
Yes, to no avail.


Posted By: Fabian
Date Posted: 05 May 2007 at 8:59am
Hello jcollier
 
I forgot to mention that the BestFit method in my code only works as follows:
 
  • load report
  • rpt.populate
  • RPT.REDRAW   <---
  • BestFit stuff
 
Hope that helps


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.3

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: jcollier
Date Posted: 07 May 2007 at 10:02am
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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net