<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : [BUG] MinimumWidth Columns</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : [BUG] MinimumWidth Columns]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 12 May 2026 23:12:04 +0000</pubDate>
  <lastBuildDate>Fri, 08 May 2009 08:43:34 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=13379</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : Hi,  I don&amp;#039;t know anymore......]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48805&amp;title=bug-minimumwidth-columns#48805</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 08 May 2009 at 8:43am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>I don't know anymore... I don't know what OCX to use anymore...&nbsp;It's beginning to spin in my head <img src="https://forum.codejock.com/smileys/smiley11.gif" border="0">&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Somewhere in OCX (I'm using now) I see .AutoColumnSizing is set to true while resizing RC's <img src="http://forum.codejock.com/smileys/smiley5.gif" border="0">&nbsp;Also when trying to resize column, the lines that are drawn to define&nbsp;the width of that column, are drawn in weird places <img src="https://forum.codejock.com/smileys/smiley5.gif" border="0"></DIV><DIV>I thought it was getting somewhere but I see still problems, I really hope I have old Beta OCX...</DIV><DIV>&nbsp;</DIV><DIV>First I need latest Beta OCX for further testing.</DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 08 May 2009 08:43:34 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48805&amp;title=bug-minimumwidth-columns#48805</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : Hi Mark, Thanks for the clarifications,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48781&amp;title=bug-minimumwidth-columns#48781</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 07 May 2009 at 9:14pm<br /><br />Hi Mark,<br><br>&nbsp;&nbsp; &nbsp;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:<br>&nbsp;&nbsp; &nbsp;<br><table width="99%"><tr><td><pre class="BBcode"><br>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<br>&nbsp;&nbsp; ' This is a generic function for adding columns to the ReportControl<br>&nbsp;&nbsp; ' It bases the starting column width on the passed miminum column width as suggested by Mark Doubson @ Codejock<br>&nbsp;&nbsp; ' See http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48715#48715<br>&nbsp;&nbsp; ' It also ensures that the column ItemIndex is correct by basing it on the column count at the time the column is added<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; With p_ReportControl<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set AddColumn = .Columns.Add(.Columns.Count, p_Caption, p_MinimumWidthPx - 10, p_Resizable)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With AddColumn<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AutoSize = p_AutoSize<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .MinimumWidth = p_MinimumWidthPx<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp; End With<br>End Function<br></pre></td></tr></table><br><br>&nbsp;&nbsp;&nbsp; It returns the newly added column so that you can easily set and additional properties as required.<br><br>&nbsp;&nbsp;&nbsp; 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. <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Here's a sample that demonstrates this problem: <br>&nbsp;&nbsp;&nbsp; <br><a href="uploads/20090507_210333_ReportC&#111;ntrolRe.zip" target="_blank">uploads/20090507_210333_ReportControlRe.zip</a><br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; 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.<br><br>&nbsp;&nbsp;&nbsp;&nbsp; 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. <br><br>&nbsp;&nbsp;&nbsp; Mark - If you prefer to do this through the support system, I can open a new ticket.<br>]]>
   </description>
   <pubDate>Thu, 07 May 2009 21:14:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48781&amp;title=bug-minimumwidth-columns#48781</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : uploads/20090507_105418_ReportControlRe.rar  Yes...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48760&amp;title=bug-minimumwidth-columns#48760</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 07 May 2009 at 10:53am<br /><br /><a href="http://forum.codejock.com/uploads/20090507_105418_ReportC&#111;ntrolRe.rar" target="_blank">uploads/20090507_105418_ReportControlRe.rar</A><DIV>&nbsp;</DIV><DIV>Yes sure </DIV>]]>
   </description>
   <pubDate>Thu, 07 May 2009 10:53:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48760&amp;title=bug-minimumwidth-columns#48760</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : Hi,  Jason or Mark, can you...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48759&amp;title=bug-minimumwidth-columns#48759</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 07 May 2009 at 10:49am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Jason or Mark, can you upload new version of working project?</DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 07 May 2009 10:49:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48759&amp;title=bug-minimumwidth-columns#48759</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : Sorry but I like to make clearabout...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48715&amp;title=bug-minimumwidth-columns#48715</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 06 May 2009 at 3:34pm<br /><br />Sorry but I like to make clear&nbsp;about recent updates for Report Contol (copy comments&nbsp;from SVN log): <DIV></DIV>Revision: 8672<BR>Author: mdoubson<BR>Date: 12:00:49, 4 &#1084;&#1072;&#1103; 2009 &#1075;.<BR>Message:<BR>add search flag xtpReportTextSearchExactStart <DIV>&nbsp;</DIV><DIV>Revision: 8676<BR>Author: mdoubson<BR>Date: 17:54:45, 4 &#1084;&#1072;&#1103; 2009 &#1075;.<BR>Message:<BR>added FindRecordItemByRows support (to efficiently cover sorted cases)<BR></DIV><DIV>Revision: 8678<BR>Author: mdoubson<BR>Date: 18:29:40, 4 &#1084;&#1072;&#1103; 2009 &#1075;.<BR>Message:<BR>fix wrong MarkUp size case<BR></DIV><DIV>As you can see - no modifications related to report sizing.</DIV><DIV>What I did - fix Jason app code to match resizing model expectation - </DIV><DIV>&nbsp;</DIV><DIV>Each visible column created with some given width and after minimum width assigned to column as a value little bit larger (e.g. 50 -&gt; 60, 100 -&gt; 110).</DIV><DIV>No need to play with <FONT size=2><strong>AutoColumnSizing.</strong></FONT></DIV><DIV><FONT size=2>I guess this is also one of rule to remember.</FONT></DIV><DIV><BR>&nbsp;</DIV><DIV></DIV>]]>
   </description>
   <pubDate>Wed, 06 May 2009 15:34:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48715&amp;title=bug-minimumwidth-columns#48715</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : Mark has updated the source to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48713&amp;title=bug-minimumwidth-columns#48713</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 06 May 2009 at 2:42pm<br /><br />Mark has updated the source to meet my expectations of the RC behaviour. In addition to these changes, some lessons learned/recommendations:<br><br>1) Call UserControl.Refresh after calling the Move method of a ReportControl on a UserControl.<br>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.<br>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).<br><br>Thanks again to Mark and Aaron for working on this problem.<br><br>]]>
   </description>
   <pubDate>Wed, 06 May 2009 14:42:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48713&amp;title=bug-minimumwidth-columns#48713</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : Thanks again Aaron, that does...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48677&amp;title=bug-minimumwidth-columns#48677</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 05 May 2009 at 5:29pm<br /><br />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.]]>
   </description>
   <pubDate>Tue, 05 May 2009 17:29:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48677&amp;title=bug-minimumwidth-columns#48677</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : Hi Jason,   I did test with...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48671&amp;title=bug-minimumwidth-columns#48671</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 05 May 2009 at 3:19pm<br /><br />Hi Jason, <DIV>&nbsp;</DIV><DIV>I did test with your test project and added code:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#666666>With lo_Col<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000000><strong>.Caption = lo_Col.Width</strong></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Visible = True<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .HeaderAlignment = xtpAlignmentCenter<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Resizable = True<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AutoSize = False<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Alignment = xtpAlignmentLeft + xtpAlignmentWordBreak<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '.MinimumWidth = p_Parent.TextWidth(.Caption) \ Screen.TwipsPerPixelX + mc_MinimumWidthPaddingPx<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug.Print p_Parent.Name &amp; ", column '" &amp; .Caption &amp; "' minimum width = " &amp; .MinimumWidth<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With</FONT></DIV><DIV><FONT color=#666666></FONT>&nbsp;</DIV><DIV><FONT color=#666666></FONT>&nbsp;</DIV><DIV><FONT color=#000000>This for showing you what I ment in <strong>4.</strong> in my previous reply. </FONT></DIV><DIV>&nbsp;</DIV><DIV>See??? After checking this you could do following:</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#000000>If you would create function in usercontrol: </FONT></DIV><DIV><FONT color=#000000>&nbsp;</FONT><FONT color=#000000></FONT></DIV><DIV><FONT color=#000000>Public Function SetPrepControl()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PrepReportControl UserControl.ReportControl1, Me<BR>End Function&nbsp;&nbsp;</FONT></DIV><DIV>&nbsp;</DIV><DIV>and&nbsp;delete line in UserControl_Initialize of course.&nbsp;&nbsp;</DIV><DIV>and call this function in form load event (like you already do with RC in form)&nbsp;the column widths of RC in form and user control will be the same.</DIV><DIV>&nbsp;</DIV><DIV>Private Sub Form_Load()<BR>&nbsp;&nbsp; UserControl11.SetPrepControl<BR>&nbsp;&nbsp; PrepReportControl Me.ReportControl1, Me<BR>End Sub</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Hope this helps you a little further <img src="http://forum.codejock.com/smileys/smiley2.gif" border="0"></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 05 May 2009 15:19:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48671&amp;title=bug-minimumwidth-columns#48671</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns : Thanks Aaron...setting AutoColumnSizing...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48644&amp;title=bug-minimumwidth-columns#48644</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 04 May 2009 at 10:35pm<br /><br />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...]]>
   </description>
   <pubDate>Mon, 04 May 2009 22:35:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48644&amp;title=bug-minimumwidth-columns#48644</guid>
  </item> 
  <item>
   <title><![CDATA[[BUG] MinimumWidth Columns :   jpbro wrote:Hi Aaron,Thanks...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48637&amp;title=bug-minimumwidth-columns#48637</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 13379<br /><strong>Posted:</strong> 04 May 2009 at 3:14pm<br /><br /><P dir=ltr style="MARGIN-RIGHT: 0px"><FONT size=2><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by jpbro" alt="Originally posted by jpbro" style="vertical-align: text-bottom;" /> <strong>jpbro wrote:</strong><br /><br />Hi Aaron,<BR>Thanks for the intervention&nbsp;<img src="http://forum.codejock.com/smileys/smiley2.gif" border="0"><BR><BR>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I have no problem with the RowHeight, as you have mentioned, that is working fine. <BR><BR>2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The problems are with the column widths (BestFit) for columns with cells with multiple lines of text (not word wrap mode, just&nbsp;vbNewline&nbsp;characters) and </FONT></P><DIV><FONT size=2>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Missing Horizontal scroll bars. </FONT></DIV><DIV><FONT size=2>&nbsp;</FONT></DIV><DIV><FONT size=2>4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; There&nbsp; 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). </FONT></DIV><DIV><FONT size=2>&nbsp;</FONT></DIV><DIV><FONT size=2>5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If you have a chance, you can tell me if I am going crazy, or if there is indeed a problem.<BR><BR>Thanks.<BR></td></tr></table></FONT></DIV><DIV><FONT size=2>&nbsp;</FONT></DIV><DIV><FONT size=2>&nbsp;</FONT></DIV><OL><LI><FONT size=2>Ok, one down and many to go hehehe </FONT><LI><FONT size=2>Bestfit doesn't work properly with vbNewLine it will be calculated as just one single string.&nbsp;Mark should be able to check this... </FONT><LI><FONT size=2>Don't know yet <img src="https://forum.codejock.com/smileys/smiley5.gif" border="0">&nbsp;But I will check this tomorrow... </FONT><LI><FONT size=2>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.&nbsp;My guess is when columns are added to&nbsp;RC the column width will be calculated per column (you can test this by adding columns and assign Column.Width&nbsp;to Caption. You will see that width of first column is bigger than last column (values decreasing). Maybe&nbsp;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) <strong>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)</strong></FONT><LI><FONT size=2>Let's hope not hehehe, this should be solved one way or another <img src="https://forum.codejock.com/smileys/smiley2.gif" border="0"></FONT></LI></OL><DIV></DIV><DIV></DIV><DIV></DIV>]]>
   </description>
   <pubDate>Mon, 04 May 2009 15:14:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13379&amp;PID=48637&amp;title=bug-minimumwidth-columns#48637</guid>
  </item> 
 </channel>
</rss>