Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Footer Rows doesn't honor BestFit
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Footer Rows doesn't honor BestFit

 Post Reply Post Reply
Author
Message
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 Topic: Footer Rows doesn't honor BestFit
    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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2008 at 11:22pm
Hi,
 
Better check your code because columns do resize for footer rows also.
 
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....
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: 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
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: 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
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: 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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)
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....
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.203 seconds.