Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] AutocolumnSizing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] AutocolumnSizing

 Post Reply Post Reply
Author
Message
Albert1 View Drop Down
Groupie
Groupie
Avatar

Joined: 01 February 2007
Location: Italy
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote Albert1 Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] AutocolumnSizing
    Posted: 08 September 2011 at 6:04am
The following code will lead to this result (wrong column width):
 

Private Sub Form_Load()
    Width = 8000
    Height = 4000
    With ReportControl1
        .Move 0, 0, ScaleWidth / 2, ScaleHeight
        .AllowColumnResize = True
        .AutoColumnSizing = False
        With .Columns.Add(0, "A", 100, False)
            .Resizable = True
            .AutoSize = False
        End With
        With .Columns.Add(0, "B", 100, False)
            .Resizable = True
            .AutoSize = True
        End With
        .Width = ScaleWidth
    End With
End Sub
 
 
 
The following code will lead to the desired layout (removed the AutoColumnSizing statement)

Private Sub Form_Load()
    Width = 8000
    Height = 4000
    With ReportControl1
        .Move 0, 0, ScaleWidth / 2, ScaleHeight
        .AllowColumnResize = True
        With .Columns.Add(0, "A", 100, False)
            .Resizable = True
            .AutoSize = False
        End With
        With .Columns.Add(0, "B", 100, False)
            .Resizable = True
            .AutoSize = True
        End With
        .Width = ScaleWidth
    End With
End Sub
 
 
How am I wrong (RC version 15)
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2011 at 1:01am
Hi,

everything is correct here. In the first case you've set AutoColumnSizing = False, therefore the columns are not automatically sized to match the report width.

In the second case AutoColumnSizing is True as well as AutoSize for the second column, therefore it gets resized.

Andre

Codejock support
Back to Top
Albert1 View Drop Down
Groupie
Groupie
Avatar

Joined: 01 February 2007
Location: Italy
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote Albert1 Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2011 at 2:58am
Originally posted by ABuenger ABuenger wrote:

Hi,
everything is correct here.
To reply without reading the original post causes a waste of time for all.
 
From the CJ's help:
 
Originally posted by CJ CJ wrote:

AutoColumnSizing (ReportControl)
If True, all columns are sized to fill the entire width of the ReportControl.  When the ReportControl is resized, the Columns will automatically be resized to fit the new size of the RepotControl.
 
If False, the columns will use the width they were assigned when they were created, or whatever value is stored in the columns width property. [cut]
 
You can ALSO set each columns AutoSize property manually.
 
AutoSize Property (ReportControl.Column):
If TRUE, the width of the column is automatically resized when the ReportControl's client area is resized by the user. If FALSE, the column keeps its initial size that was specified when the column was created.
NOTE:  When a column is added, the Resizable parameter is used to set the value for BOTH the Resizable and AutoSize property.  If these properties will have a different value, then you will have to change the required value after the column has been added.
 
Well, in the first example I set the AutoColumnSizing to False (I wish the default is NO AutoSize) but I set manually AutoSize property to the Column (why not?) but the result is no autosize at all.
In the second example I removed the reference to the AutoColumnSizing property (at RC level): all works fine.
 
THIS IS A BUG!!!
Note: Or CodeJock should append ANOTHER (!!!) note in the help to advice "you cannot use BOTH AutoColumnSizing at ReportControl level and AutoSize at ReportColumn level" ...
 
cu
 
 
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2011 at 7:13am
I might be wrong, but my understanding of the Column.AutoSize property is that it is only valid if the Report.AutoColumnSizing = True. Basically, you can exempt certain columns from the auto column sizing feature by setting the AutoSize property to False

If AutoColumnSizing = False, then the AutoSize property of each column is ignored, since no auto-sizing will be taking place.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2011 at 11:59am
Originally posted by jpbro jpbro wrote:

I might be wrong, but my understanding of the Column.AutoSize property is that it is only valid if the Report.AutoColumnSizing = True. Basically, you can exempt certain columns from the auto column sizing feature by setting the AutoSize property to False

If AutoColumnSizing = False, then the AutoSize property of each column is ignored, since no auto-sizing will be taking place.


This is correct. Maybe the help isn't clear enough here.

Codejock support
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.172 seconds.