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

[BUG] MinimumWidth Columns

 Post Reply Post Reply
Author
Message
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 Topic: [BUG] MinimumWidth Columns
    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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 15 February 2009 at 12:19am
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?
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: 15 February 2009 at 5:32am
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:
  1. Drag a few columns to groupbox and resize form, just enough that only first 3 columns are showing
  2. Use ARROW RIGHT key to select a column that isn't visible

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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 15 February 2009 at 11:53am
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
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: 18 February 2009 at 5:46am
Originally posted by mdoubson mdoubson wrote:

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
 
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 18 February 2009 at 9:37am
Hi Aaron - I already did it couple days ago
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: 19 February 2009 at 1:18pm
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2009 at 1:34pm
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.
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: 19 February 2009 at 1:55pm
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 20 February 2009 at 4:00pm
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?!
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 February 2009 at 10:36am
Hi Mark,
 
With new OCX this still doesn't work.
 
  1. See image first post.
  2. I don't see scrollbars when resizing RC less than total columnwidth (with Column.MinimumWidth = 100) You said you would implement this...
 
 
 
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 21 February 2009 at 12:25pm
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.
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 February 2009 at 12:57pm
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 21 February 2009 at 1:10pm
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.
 
 
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 February 2009 at 4:30am
Originally posted by mdoubson mdoubson wrote:

 
 
[...]
 
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.
 
[...] 
 
 
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2009 at 6:27pm
 
Hi, Aaron - your VB test working well after I changed FullColumnScrolling flag.
Please try recent OCX version yourself and confirm.
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2009 at 6:32pm
Code is better than properties bag (IDE) (if possible) - this is that I consider as easy to check.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2009 at 11:53am
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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2009 at 12:31pm
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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2009 at 3:41pm
I found another problem with the MinimumWidth property (in 13.0 and the ReportControl.ocx linked above).

This code:


      For i = 0 To .Columns.Count - 1
         With .Columns(i)
              .MinimumWidth = UserControl.TextWidth(.Caption) \ Screen.TwipsPerPixelX + 5
         End With
      Next i


Produces the correct (or at least expected) result of:



Modifying the code to set the minimum width 1 pixel or more wider:


      For i = 0 To .Columns.Count - 1
         With .Columns(i)
              .MinimumWidth = UserControl.TextWidth(.Caption) \ Screen.TwipsPerPixelX + 6
         End With
      Next i


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

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: 03 May 2009 at 4:49am
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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 2:49pm
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):

  1. Resize window to minimum width, and then resize wider...the AutoSize for the "Subject" column is now broken (this doesn't happen in 13.0)
  2. Set the mc_MinimumWidthPaddingPx constant in the FiveOutbox.ctl file 6 and the mc_AutoColumnSizing constant to True and re-run the project. The column widths are now broken.
  3. Remove the comment character (') from the mc_SampleRecipients constant in the FiveOutbox.ctl file (to get multi-line recipients) and re-run the project. The BestFit method on the Recipients column measures the width of all 3 lines instead of just the longest line.
  4. Set the mc_MinimumWidthPaddingPx constant to 6 and set the mc_AutoColumnSizing constant the False, and the re-run the project. The "Date Written" column is missing. In 13.0 the problems are even worse (columns missing, column dividers missing). Change the mc_MinimumWidthPaddingPx back to 5 and everything looks OK.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

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: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 3:01pm
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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 3:15pm
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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 9:58pm
UPDATED SAMPLE TWO POST DOWN
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 10:44pm

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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 11:10pm
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 11:31pm
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.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 11:41pm
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2009 at 11:51pm
This is beta-version of RC ActiveX from May02 - it will work till June 01:
 
 
Good - I am sure that the most simple test case with bug effect will be better for everyone who want to participate in our testing.
I also like to have a rule for VB test case samples - all settings should be explicitly made in Form Load function and we don't need to look in PropertyBag to find what are our current settings. It is really help to make all clean and easy to reproduce.
 
Thanks. I recommend you to use attached control for testing - other case we can't test at all as can have different results.
 
Btw - I did not find any problem running your test case but you did not put any record and items in Report - only "You output box is empty" string presented. Is it your intention for this test? General resizing and scrollbar working properly.
 
This is your test case exe builded with ActiveX form May 02:
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: 04 May 2009 at 9:46am
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 10:03am
Essentially there is nothing wrong in UserControl layout inside the form - in my settings it show 100% proper resize
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 10:59am
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:07am
I still not understand - you are still playing with 13.0? Did you tried attached 13.1 version?
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:16am
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:

Quote
Forum: Report Control
Topic: BUG: MinimumWidth Columns
Posted By: mdoubson

Good - I am sure that the most simple test case with bug effect will be better for everyone who want to participate in our testing.


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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:23am
I don't know how you handle internal recising of Report Control inside UserControl - please give more details. May be the problem is there?
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:30am
Everything is in the sample provided above...


Private Sub UserControl_Resize()
   With UserControl.ReportControl1
      .Move 0, 0, UserControl.ScaleWidth, UserControl.ScaleHeight
   End With
End Sub


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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:32am
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:39am
Good - so if you properly set container in the form as I did - you have no problems with internal RC resizing.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:51am
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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 11:53am
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

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: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 12:17pm
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 12:27pm
I tried both - for me multiline case also working well
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 12:36pm
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 12:40pm
I run VB project - which give me only singleline case. I also run your builded exe for both cases. I use XP - SP3
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 12:50pm
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 1:03pm
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.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 1:06pm
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 1:11pm
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!
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 1:14pm

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()
   With UserControl.ReportControl1
      .Move 0, 0, UserControl.ScaleWidth, UserControl.ScaleHeight
   End With
   UserControl.Refresh
End Sub

 

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: 04 May 2009 at 1:34pm
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 1:38pm
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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 2:19pm
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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 2:22pm
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 2:36pm
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;

}

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: 04 May 2009 at 3:14pm

Originally posted by jpbro jpbro wrote:

Hi Aaron,
Thanks for the intervention 

1.          I have no problem with the RowHeight, as you have mentioned, that is working fine.

2.          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

3.          Missing Horizontal scroll bars.
 
4.          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).
 
5.          If you have a chance, you can tell me if I am going crazy, or if there is indeed a problem.

Thanks.
 
 
  1. Ok, one down and many to go hehehe
  2. Bestfit doesn't work properly with vbNewLine it will be calculated as just one single string. Mark should be able to check this...
  3. Don't know yet  But I will check this tomorrow...
  4. If you would create a function and call this function with a button on the form, you will see that all columns will be added with same width. I did this and both RC's have same column widths, also resizing will be the same for all columns. My guess is when columns are added to RC the column width will be calculated per column (you can test this by adding columns and assign Column.Width to Caption. You will see that width of first column is bigger than last column (values decreasing). Maybe total width of RC in form and in usercontrol are different when columns are added. I don't know if this making any sense, if not I will create test for you (will be tomorrow also) Also try with AutoColumnSizing = False at startup and after loading columns and records set AutoColumnSizing = true (this will have at least same col widths at startup)
  5. Let's hope not hehehe, this should be solved one way or another
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
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2009 at 10:35pm
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

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: 05 May 2009 at 3:19pm
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....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2009 at 5:29pm
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

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

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2009 at 2:42pm
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

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

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2009 at 3:34pm
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.

 
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: 07 May 2009 at 10:49am
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....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 07 May 2009 at 10:53am
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 07 May 2009 at 9:14pm
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:
    

Private Function AddColumn(ByRef p_ReportControl As ReportControl, ByVal p_Caption As String, ByVal p_MinimumWidthPx As Long, ByVal p_Resizable As Boolean, ByVal p_AutoSize As Boolean) As ReportColumn
   ' This is a generic function for adding columns to the ReportControl
   ' It bases the starting column width on the passed miminum column width as suggested by Mark Doubson @ Codejock
   ' See http://forum.codejock.com/forum_posts.asp?TID=13379&PID=48715#48715
   ' It also ensures that the column ItemIndex is correct by basing it on the column count at the time the column is added
  
   With p_ReportControl
      Set AddColumn = .Columns.Add(.Columns.Count, p_Caption, p_MinimumWidthPx - 10, p_Resizable)
      With AddColumn
         .AutoSize = p_AutoSize
         .MinimumWidth = p_MinimumWidthPx
      End With
   End With
End Function


    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

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: 08 May 2009 at 8:43am
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....
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.234 seconds.