[BUG] MinimumWidth Columns |
Post Reply |
Author | ||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
Posted: 10 February 2009 at 2:33pm |
|
Hi,
When setting a MinimumWidth (this is newly added property in V13.0.0) for columns the row focus rect doesn't get properly calculated
Just add 10 columns, a few records and set AutoColumnSizing to True and resize ReportControl.
You will get this:
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
What is your expectaction in this case: you force some columns to have width >= min width. If result not fit - you suppose to extend form size (or I can auto change mode to use scrollbar?). What if you not set AutoColumnSizing?
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Mark,
The problem is:
If the contents doesn't fit and you would use ARROW LEFT key to select last column, you will see that focusrect is "cut off" (even GroupLines are "cut off".
To reproduce:
You should get output like this: |
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Hi, Aaron, I see the problem in the case and will fix it. Btw - your sample treats by small modification:
Private Sub Form_Resize()
wndReportControl.AutoColumnSizing = True wndReportControl.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight wndReportControl.AutoColumnSizing = False End Sub Now all working fine - try please
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Mark,
You could implement this in ReportControl, so it shows automatically horizontal scrollbar when resizing. When setting AutoColumnSizing = False it already shows horizontal scrollbar when RC width is less than columns width in header.
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Hi Aaron - I already did it couple days ago
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Mark,
Thanks a lot and keep up the good work
If you need help with testing with newly added features and fixes, just let me know, OK?
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
uploads/20090220_155842_ReportSampleSat.rar
Thanks, Aaron. I am having some problems with your VB TestDivider as you use 2 modes same time - drop column to group and hide it in main table and drop column and keep it in main table (essintially I think that using my flag m_bHideColumnAfterGroupBoxDrop we can keep consistent behaviour). Hope I can covered your 2-modes case also.
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Mark,
If you would let me try your updated OCX, I would know the pro's and con's with newly added functions/features.
Thanks
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Hi, as a test case I upload current version of MFC ReportSample where you can try all new features:
btw - I sent Aaron debug version of ActiveX using his forum account e-mail but there is no reaction - guess this is old e-mail?!
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Mark,
With new OCX this still doesn't work.
Thanks
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Hi, Aaron, could you run my static MFC ReportSample and check TaskListView - it show desired Layout Adjustment:
I will check what is different if you call from OCX.
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Mark,
MFC sample shows horizontal scrollbar when resizing...
Are you sure you did set MinimumWidth for columns and AutoColumnSizing = True?
Thanks
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Hi, Aaron,
all columns was created with bAllowSize = TRUE;
wndReport.AddColumn(new CXTPReportColumn(COLUMN_TYPE, _T("Type"), 18, bAllowSize, 0)); all columns use wndReport.GetColumns()->GetAt(iC)->SetMinWidth(100); (in loop)
it's all - other settings - defaults (m_bAutoColumnSizing = TRUE) plus cosmetic:
wndReport.GetPaintManager()->SetGridStyle(TRUE, xtpReportGridSolid); wndReport.GetPaintManager()->SetDrawGridForEmptySpace(TRUE); wndReport.FocusSubItems(TRUE); wndReport.AllowEdit(TRUE); wndReport.Populate();
P.S. I found the diff - in your VB PropertyBag (I hate it as easy to check code!) you had FullColumnScrolling TRUE.
If you will change to FALSE - will see another behaviuor.
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Mark,
I changed FullColumnScrolling = False and still no horizontal scrollbar. You can test it yourself with my uploaded test project. There has to a difference between MFC and ActiveX and that's why I always upload test project and I never look in the MFC forum... There are to many differences between MFC and ActiveX.
btw. In futere I will set properties in IDE and not in code, OK? (I wanted to be sure that the property was set when running the test because of some problems in past...)
Thanks
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Code is better than properties bag (IDE) (if possible) - this is that I consider as easy to check.
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
I've noticed a problem where the Horizontal scrollbar doesn't appear when AutoColumnSizing = True but the ReportControl width is less than the total columns width after calling BestFit on the columns. It sounds like this may have been fixed (based on posts above), but I'm not sure (I can't get the latest ReportControl to work in the IDE). Has this been fixed?
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Ok, I compiled my test app and then registered the ReportControl update linked above. I found the following problems:
1) The HorizontalScrollbar doesn't appear until the user resizes the form (which in turn resizes the ReportControl) 2) AutoColumnSizing = True seems to be ignored now (my ReportControl has a single column with AutoSize = True, and no sizing is occuring with the new ReportControl.ocx...Works fine with 13.0) 3) The HorizontalScrollbar calculation is short...the right-most column gets cut off: |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
I found another problem with the MinimumWidth property (in 13.0 and the ReportControl.ocx linked above).
This code:
Produces the correct (or at least expected) result of: Modifying the code to set the minimum width 1 pixel or more wider:
Produces this result: The first two columns have the AutoSize property set to False, the Subject column has AutoSize set to True and the two icon columns have AutoSize and Resizable properties set to False. If you subsequently try to resize the too short columns, they will snap to the expected minimum width. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Jason,
Can you upload test project?
Thanks
|
||
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.... |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Hi Aaron,
I haven't been able to reproduce the scrollbar width too short problem yet...I'll keep trying (I forget the exact combination of settings that caused that problem yet). I have been able to reproduce some other bugs with the following sample: SEE UPDATED SOURCE FIVE POSTS DOWN Try the sample project after registering the ReportControl.ocx that Mark provided and compare to the 13.0 ReportControl. Here are the problems (and steps required to reproduce them):
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Forgot to say thanks for taking a look!
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Another problem:
Remove the comment character (') from the mc_SampleRecipients constant in the FiveOutbox.ctl file (to get multi-line recipients) and re-run the project. No horizontal scrollbar appears. Start resizing the form width smaller...eventually the Horizontal scrollbar will appear. Now resizing the form width smaller and larger, and the Horizontal scrollbar appears to be working as expected. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
UPDATED SAMPLE TWO POST DOWN
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
You project is full of foreign controls. Get rid of them and make real test case with nothing else except standard VB and CJ Report Control ActiveX please |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Hi Mark,
Sorry, I've been busy with actual work, and I rushed the sample. In any case, there are no foreign controls, but I left behind some references..If you took the same amount of time to clear the references and the 1 function that relied on them instead of leaving a snarky message, then the test case would have worked for you. In any case, here's the updated project: uploads/20090503_230917_ReportControlRe.zip |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
OK - now project works, all your sizing constant (for min values) are funny small as you are working not in pixel space. Why so name test case for resizing need UserControl - could you have same effect with ReportControl be direct part of form? You resizing function does not show control position during resizing - change it e.g. as I did - now I am sure that it properly fill form after form size changed:
Private Sub Form_Resize()
With Me.FiveOutbox1 '.Move .Left, .Top, Me.ScaleWidth - (.Left * 2), Me.ScaleHeight - (.Top * 2) ' YOUR CODE .Move 200, 200, Me.ScaleWidth - 400, Me.ScaleHeight - 400 'MY CODE End With End Sub
Thanks for you post - I like you make it more transperent so we can catch the problem and fix it.
What is ActiveX timestamp you are testing now? The current one stamped by May02.
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
I am using a stripped down version of the code that I am working on for a product, that is why the ReportControl is on a UserControl...I left it this way to show the conditions under which I found the problems. It's possible that the problems don't exist when the RC is placed on a form instead of on a UserControl (I haven't tested this), but my requirements include putting the RC on a UserControl (for use on multiple forms), so I wanted an accurate representation of my conditions.
The code you changed is not particularly relevant to the problems I am experiencing, it simply resizes the control the the ScaleWidth and ScaleHeight of the form less twice the Left position and twice the Top position. It's code I use everywhere because it means that I can move the usercontrol in the designer and it will still be resized properly. Your code forces the User control to a specific position and width. In either case, I can't see how the code would affect the problems I have outlined. I am currently using a build with timestamp of February 23, 2009, so obviously it is out of date. I will open a support ticket for the latest build for testing. I will try to find the time to create a simpler sample ASAP. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Jason,
I see difference with new OCX so I suggest you test your project again and if things aren't working as they should work just create a new testproject which is easier to test with. I don't think using usercontrol is making a difference but for testing your problem, it would be easier
Thanks
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Essentially there is nothing wrong in UserControl layout inside the form - in my settings it show 100% proper resize
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
It's is possible that the problems I am experiencing are with the older RC build, but I'm still waiting on the updated build from support. I have made a new sample that shows some (but not all) of the problems I reported earlier (still working to reproduce some of the problems).
There is a definitely some different behaviour when the RC is placed on a UserControl. Here's a screenshot with a Form RC (Top) and UserControl RC (bottom) on the same form, using the same code base: The problem with the AutoSize getting disabled after resizing the form still exists, and the BestFit calculation problem with multi-line cell text still exists. Sample: uploads/20090504_105810_ReportControlRe.zip |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
I still not understand - you are still playing with 13.0? Did you tried attached 13.1 version?
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
I was using 13.1 from Feb23. I didn't get a support reply for the new
OCX, and I only just now noticed the link to the latest 13.1 build in
your post, because the e-mail version of your post didn't have the
link...It only said:
I have now tried the new vesion and the AutoSize disabling bug appears to be fixed, thank you. There are still a problem with UserControl vs. Form column sizing for the RC, and multi-line BestFit though: (Form only RC on top, UserControl RC bottom - There shouldn't be a difference between the two since they both use the same populating code) |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
I don't know how you handle internal recising of Report Control inside UserControl - please give more details. May be the problem is there?
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Everything is in the sample provided above...
The RC inside the UserControl is the right size because you can see the Horizontal scrollbar completely. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Sorry, I think I may have found my mistake...I forgot to call BestFit in UserControl...will test and get back to you.
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Good - so if you properly set container in the form as I did - you have no problems with internal RC resizing.
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Okay, calling BestFit means the UserControl and Form-only RC match on
startup. Sorry for the mistake. There are still some problems though.
1) At startup, the horizontal scrollbar is not visible even though 1 column is off the edge of the visible area: 2) After shrinking the form width slightly, the UserControl and Form-only RC column widths get out of sync (but all columns are visible as expected): 3) If you shrink the form width further, the right-most column is off the edge of the visible area, but there is still no horizontal scrollbar: 4) If you shrink the form width further, you will eventually get a horizontal scrollbar (it will have the correct scrolling width available, that is when you scroll it to the right, the rightmost column will be visible as expected): |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
I should add that the problem appears to be with the Multiline calculations. If you run the included RCRedrawSingleLine.exe everything appears to work as expected.
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
I tried both - for me multiline case also working well
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
I've tested the May 2, 2009 build on Windows Vista and Windows 2000 - both OSes exhibit the same problematic behaviour (as shown in the screenshots). Are you testing with the EXEs or source code that I provided? Or on a different OS? Or a newer build?
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
I run VB project - which give me only singleline case. I also run your builded exe for both cases. I use XP - SP3
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
I just tested on an XP SP3 machine that never had CJ controls installed, and only registered the May 2, 2009 OCX. Same problems as shown in the screenshots for the RCRedrawMultiline EXE. Are you using a newer build?
Maybe somebody else could confirm or deny the problem? |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Where is your code for multiline case? BTW - this is not a proper way to work together - please open Issues and we can go on with this problem and after report to Forum about results.
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
It's the same code...just modify the mc_SampleRecipients constant in Module1.bas to use multiple lines (remove the comment character). I'll open a support issue now.
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Sorry - this is not multi-line mode. Multi-line mode controlled by Format Flags. This is single line mode with few individual lines - they not wrap with size changes!
|
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
See - I changed ONE LINE in your USER CONTROL code and now it works - this is a problem with YOUR RESIZING CODE I asked Private Sub UserControl_Resize()
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Jason,
I don't want to disturb a good marriage but what is still a problem? If it's only resizing rowheight with contents, I can confirm this is working properly with new OCX. With old one it is a problem indeed.
Maybe I can help you with something or has issue been solved now?
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
He just need to call UserControl.Refresh
I did it for ONE control in his form and don't touch it's duplicate - and we behave differently now
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
All I meant by multi-lines was that there were multiple lines of text, not just a single line. I'm not using or talking about what I would call WordWrap.
As for the UserControl.Refresh line, it works to show the complete ReportControl header when the RC is on a UserControl, but there are still scrollbar problems. I'm not sure why you are being so adversarial as I provided my code about 13 posts ago. I'm also not sure how I was supposed to know that the ReportControl requires a parent refresh after a call to the Move method. I've never had to do that with any other controls. In any case, thanks for the tip. As mentioned though, there are still scrollbar problems when there are multiple lines of text (with vbNewline, not Word Wrap multiline mode) even with the addition of the Refresh code. Here's the screenshot at startup: NOTES: Even though the entire header is now visible at startup, the columns don't match between the Form only and UserControl RC columns. Not sure why, but this isn't my biggest problem right now. After shrinking the width of the form a bit, you will eventually get to a point where the header is outside the visible area of the form, but there is no horizontal scrollbar: Finally, if you shrink the form width further, you will eventually see the horizontal scrollbar: Here's the updated sample. The RCRedrawMultiline.exe demonstrates the problem. uploads/20090504_141837_ReportControlRe.zip |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Hi Aaron,
Thanks for the intervention I have no problem with the RowHeight, as you have mentioned, that is working fine. The problems are with the column widths (BestFit) for columns with cells with multiple lines of text (not word wrap mode, just vbNewline characters) and missing Horizontal scroll bars. There also seems to be a mysterious difference between the column sizing when the RC is on a Form and when it is on a UserControl (see screenshots and sample above). If you have a chance, you can tell me if I am going crazy, or if there is indeed a problem. Thanks. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
This is not so complecated but still special logic involved so you should use something special in UserControl (at least call Refresh!)
And this is not only about Report - as in CJ with Skins and other fancy features there are sometimes timers used to adjust layout -
this is not just MoveWindow call!
e.g.
void CXTPReportControl::OnSize(UINT nType, int cx, int cy)
{ if (m_bOnSizeRunning) return; m_bOnSizeRunning = TRUE; BOOL b = GetReportHeader()->ForceLayoutAdjustment(); if (b) GetReportHeader()->SetAutoColumnSizing(TRUE); CWnd::OnSize(nType, cx, cy); AdjustLayout(); AdjustScrollBars(); BOOL bb = GetReportHeader()->ForceLayoutAdjustment(); //<<<>>> if (bb)GetReportHeader()->SetAutoColumnSizing(FALSE); else if (b) //<<<>>>GetReportHeader()->SetAutoColumnSizing(TRUE); //<<<>>>m_bOnSizeRunning = FALSE; } |
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
|
||
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.... |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Thanks Aaron...setting AutoColumnSizing = True in the UserControl_Show event seems to match the Auto/BestFit sizing when using a ReportControl on the Form only...
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi Jason,
I did test with your test project and added code:
With lo_Col
.Caption = lo_Col.Width .Visible = True .HeaderAlignment = xtpAlignmentCenter .Resizable = True .AutoSize = False .Alignment = xtpAlignmentLeft + xtpAlignmentWordBreak '.MinimumWidth = p_Parent.TextWidth(.Caption) \ Screen.TwipsPerPixelX + mc_MinimumWidthPaddingPx Debug.Print p_Parent.Name & ", column '" & .Caption & "' minimum width = " & .MinimumWidth End With This for showing you what I ment in 4. in my previous reply.
See??? After checking this you could do following:
If you would create function in usercontrol:
Public Function SetPrepControl()
PrepReportControl UserControl.ReportControl1, Me End Function and delete line in UserControl_Initialize of course.
and call this function in form load event (like you already do with RC in form) the column widths of RC in form and user control will be the same.
Private Sub Form_Load()
UserControl11.SetPrepControl PrepReportControl Me.ReportControl1, Me End Sub Hope this helps you a little further
|
||
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.... |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Thanks again Aaron, that does help and I think we are getting close to the expected behaviour (or at least the behaviour that I would expect). I'm now communicating with Mark over the support system and I will post back here when we have a resolution.
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Mark has updated the source to meet my expectations of the RC behaviour. In addition to these changes, some lessons learned/recommendations:
1) Call UserControl.Refresh after calling the Move method of a ReportControl on a UserControl. 2) Don't prepare your ReportControl (when on a UserControl) in the UserControl_Initialized event, instead create a public sub and call it from Form_Load. 3) When using RC on a UserControl, it is recommended to set the ScaleMode to vbPixels (if only for easier debugging since RC uses pixels exclusively for its internal measurements). Thanks again to Mark and Aaron for working on this problem. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
Sorry but I like to make clear about recent updates for Report Contol (copy comments from SVN log):
Revision: 8672
Author: mdoubson Date: 12:00:49, 4 мая 2009 г. Message: add search flag xtpReportTextSearchExactStart Revision: 8676
Author: mdoubson Date: 17:54:45, 4 мая 2009 г. Message: added FindRecordItemByRows support (to efficiently cover sorted cases) Revision: 8678
Author: mdoubson Date: 18:29:40, 4 мая 2009 г. Message: fix wrong MarkUp size case As you can see - no modifications related to report sizing.
What I did - fix Jason app code to match resizing model expectation -
Each visible column created with some given width and after minimum width assigned to column as a value little bit larger (e.g. 50 -> 60, 100 -> 110).
No need to play with AutoColumnSizing.
I guess this is also one of rule to remember.
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi,
Jason or Mark, can you upload new version of working project?
Thanks
|
||
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.... |
||
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Hi Mark,
Thanks for the clarifications, they were very helpful. In case anyone is interested, here's a routine that is useful for adding columns to a ReportControl, using Mark's suggestion of setting the starting width to slightly less than the Minimum width:
It returns the newly added column so that you can easily set and additional properties as required. In other news, I have isolated what appears to be a problem with the horizontal scrollbar appearance under a specific circumstance. If a column has its Resizable property set to True, and its AutoSize property set to False, then the HSB doesn't appear when you would expect it to. Here's a sample that demonstrates this problem: uploads/20090507_210333_ReportControlRe.zip In the sample, there are 2 ReportControls (upper and lower). The only difference between them is that in the upper RC, the DateWritten column has the Resizable property set to True, while the lower RC has the Resizable property set to False. The upper RC doesn't show the horizontal scrollbar immediately after the right-most column extends beyond the visible area of the control, while the lower RC works perfectly. My best guess is that the algorithm used to determine visibility of the HSB is basing the decision on the MinimumWidth of the column instead of the displayed width of the column, but I'm not 100% sure of this. I'll just think out-loud here for a moment - Maybe a BeforeColumnResize event would be useful, because then we could manage minimum widths, maximum widths and resizability ourselves based on dynamic requirements at runtime. Something like: BeforeColumnResize(Column As ReportColumn, Cancel As Boolean). Setting Cancel to True would prevent the column from being resized by the user. Mark - If you prefer to do this through the support system, I can open a new ticket. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi,
I don't know anymore... I don't know what OCX to use anymore... It's beginning to spin in my head
Somewhere in OCX (I'm using now) I see .AutoColumnSizing is set to true while resizing RC's Also when trying to resize column, the lines that are drawn to define the width of that column, are drawn in weird places
I thought it was getting somewhere but I see still problems, I really hope I have old Beta OCX...
First I need latest Beta OCX for further testing.
Thanks
|
||
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.... |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |