Print Page | Close Window

Footer Rows doesn't honor BestFit

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=10725
Printed Date: 29 April 2024 at 4:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Footer Rows doesn't honor BestFit
Posted By: Fabian
Subject: Footer Rows doesn't honor BestFit
Date Posted: 21 May 2008 at 10:10am
Hi
I have sent 2 messages to issue track but got no answer (also no automated response?). So I ask forum:
 
If I set BestFitMode to honor all column widths, shown or not, this works fine for 'normal' rows, but footer row sizes would not be hored for calculating the column sizes.
 
Do I miss something?
 
Thanks for help
 


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

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6



Replies:
Posted By: Aaron
Date Posted: 21 May 2008 at 11:22pm
Hi,
 
Better check your code because columns do resize for footer rows also.
 
https://forum.codejock.com/uploads/20080521_232104_TestColumns.zip - uploads/20080521_232104_TestColumns.zip


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Fabian
Date Posted: 22 May 2008 at 10:20am
Hi Aaron
 
Thanks for your sample. It works because the first column with the long footer text was visible.
 
But look: If you set the long footer text ''This text is longer...' to the last column and fill the report control. Make the last column small. Adjust the column with of the first column so the last column totally vanishes. Then press your bestfit button, the whole column wasn't resized. Set Column.BestFitMode=xtpBestFitModeAlldata and repeat. The last column honors all 'normal' rows but not the long footer text.
 
So I came to the conclusion: BestFit doesn't honor BestFitMode=xtpBestFitModeAlldata


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

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: Aaron
Date Posted: 22 May 2008 at 12:09pm
Hi,
 
If you set the long text for the last column you have to set:
 
wndReportControlData.Columns(3).BestFitMode = xtpBestFitModeAllData
wndReportControlData.Columns(3).BestFit
 
as well. I made the sample just to let you see it does work.
 
change this in the sample:
 
Private Sub Command3_Click()
    Dim col As ReportColumn
    For Each col In wndReportControlData.Columns
        col.BestFitMode = xtpBestFitModeAllData
        col.BestFit
        DoEvents
    Next col
End Sub
 
Now all columns will call BestFit and not as in my first example with just the first column and if you set the longer text to another column it won't work
 
Change the above and see for yourself.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Fabian
Date Posted: 23 May 2008 at 1:52am
Hi Aaron
 
I had called the best fit method to column 3 and it won't work.
 
Your sample simply works because you use DoEvents in the loop. This is an old trick for the same problem with BestFit before .BestFitMode was introduced. But it does not always work. I am shure that for the footer rows the BestFitMode was not taken into account...
 
Thanks again


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

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: Aaron
Date Posted: 23 May 2008 at 3:26am
Hi,
 
Yes, I had to use DoEvents otherwise it did't work. But it shows that all columns will be resized, also the FooterRows and if you think that it doesn't work all the time, show me
 
You say and I quote:
I am shure that for the footer rows the BestFitMode was not taken into account...
 
They have to be checked for the contents of the "cell" otherwise the columns wouldn't be resized, right? That we have to use DoEvents is another story...
 
I will wait for a few days and I will post an issue regarding the BestFit method (giving Oleg the time to reply on this post


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Fabian
Date Posted: 23 May 2008 at 9:48am
Hi Aaron
 
Yes, but if BestFitMode is 0 or not taken into account only the width of visible cells are measured. So your sample works if you have long text in the first, visible column but not in the last, hidden row.
 
Why it works from time to time with DoEvents - no idea. In V11 before BestFitMode was introduced I also used DoEvents AND .Poulate but sometimes it works sometimes not - depends on Windows repainting (sizing, pane sizing, overlaping windows...).
 
But - thanks a lot, I hope Oleg have the time to examine this issue.


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

Platform: Windows 7 (32bit)

Language: Visual Basic 6.0 / SP6


Posted By: Aaron
Date Posted: 23 May 2008 at 10:07am
Hi,
 
With my sample it does not matter if xtpBestFitModeAllData or xtpBestFitModeVisibleData is set, it will always resize the long text and no matter where the column is and visible or not.
 
Please add code that it won't work. Convince me that this doesn't work
 
(I added the code where I loop through the columns)
https://forum.codejock.com/uploads/20080524_021103_TestColumns.zip - uploads/20080524_021103_TestColumns.zip


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



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