Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - BestFit Question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

BestFit Question

 Post Reply Post Reply
Author
Message
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Topic: BestFit Question
    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?


Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2007 at 5:49pm
Have you disabled AutoColumnSizing property before calling this method?

--
WBR,
Serge
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2007 at 2:57pm
Nothing new here?
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2007 at 10:01am
Has CJ recreated this?
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2007 at 12:21pm
Hello?
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2007 at 4:41pm
Yes, to no avail.
Back to Top
Fabian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 November 2004
Location: Switzerland
Status: Offline
Points: 336
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fabian Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.266 seconds.