Print Page | Close Window

[SOLVED] AutocolumnSizing

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=18919
Printed Date: 10 May 2024 at 8:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] AutocolumnSizing
Posted By: Albert1
Subject: [SOLVED] AutocolumnSizing
Date 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)




Replies:
Posted By: ABuenger
Date 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


Posted By: Albert1
Date 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)



Posted By: jpbro
Date 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



Posted By: ABuenger
Date 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



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