<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69500.aspx</link><pubDate>Mon, 22 Aug 2011 14:46:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69500</guid><dc:creator>alexteno</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69500.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69500</wfw:commentRss><description>&lt;br /&gt;Hey gentleman. Greatly appreciate all your help. Works wonderfully
&lt;br /&gt;
&lt;br /&gt;We were able to use a section and a check box (with Conditional Formatting) as a strong visual indicator that something on the form had been marked
&lt;br /&gt;
&lt;br /&gt;More importantly though...
&lt;br /&gt;The ridiculous load times have been essentially eliminated by using this paging idea. I set up our form to page through several at a time and by default load with 10. It is loading significantly faster with only 10 lines since (responding to TedCa), yes, we are using RTF boxes and not plaintext. Sadly though these RTF boxes are part of our requirements.
&lt;br /&gt;
&lt;br /&gt;In regards to code, I&amp;#39;ve added a little bit of stuff past the initial single line as follows
&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;.NET Coded events&lt;/b&gt;
&lt;br /&gt;

&lt;br /&gt;public void pageAmount_Changed(object sender, XmlEventArgs e)
&lt;br /&gt;{
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/@my:pageNo&amp;quot;, NamespaceManager).SetValue(&amp;quot;0&amp;quot;);
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;public void PageNext_Clicked(object sender, ClickedEventArgs e)
&lt;br /&gt;{
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int i;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;i = (int)CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/@my:pageNo&amp;quot;, NamespaceManager).ValueAsInt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;i--;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/@my:pageNo&amp;quot;, NamespaceManager).SetValue(i.ToString());
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;public void PagePrev_Clicked(object sender, ClickedEventArgs e)
&lt;br /&gt;{
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int i;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;i = (int)CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/@my:pageNo&amp;quot;, NamespaceManager).ValueAsInt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;i++;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CreateNavigator().SelectSingleNode(&amp;quot;/my:myFields/@my:pageNo&amp;quot;, NamespaceManager).SetValue(i.ToString());
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;Fields, Objects, Attributes, Etc...&lt;/b&gt;
&lt;br /&gt;pageNo - WholeNumber - Default Value: Expression: 0, Updating
&lt;br /&gt;pageMax - Text - Default Value: Expression: max(&lt;i&gt;RepeatingTable\LineNo&lt;/i&gt;), Updating
&lt;br /&gt;pageAmount - Text
&lt;br /&gt;pageUpper - Text - Default Value: Expression: @pageMax - (@pageNo * pageAmount)
&lt;br /&gt;pageLower - Text - Default Value: Expression: concat(substring(&amp;quot;0&amp;quot;, 1, (@pageMax 
&lt;br /&gt;Note the above was a boolean statement in order to prevent my lower field from being a negative value (stops at zero), I imagine some of you guys have already seen this kind of expression
&lt;br /&gt;
&lt;br /&gt;Form Load Rule:
&lt;br /&gt;Always Runs - concat(substring(&amp;quot;99999&amp;quot;, 1, ((get-Role() = &amp;quot;Role1&amp;quot;) or (get-Role() = &amp;quot;Role2&amp;quot;) or (get-Role() = &amp;quot;Role3&amp;quot;)) * string-length(&amp;quot;99999&amp;quot;)), substring(&amp;quot;10&amp;quot;, 1, (not(((get-Role() = &amp;quot;Role1&amp;quot;) or (get-Role() = &amp;quot;Role2&amp;quot;) or (get-Role() = &amp;quot;Role3&amp;quot;)))) * string-length(&amp;quot;10&amp;quot;)))
&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;Conditional Formatting:&lt;/b&gt;
&lt;br /&gt;
&lt;br /&gt;Repeating Table:
&lt;br /&gt;if &lt;i&gt;RepeatingTable\LineNo&lt;/i&gt; &amp;gt; pageUpper &lt;b&gt;or&lt;/b&gt;
&lt;br /&gt;if &lt;i&gt;RepeatingTable\LineNo&lt;/i&gt; 
&lt;br /&gt;Hide this Control
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;Again, thanks for all your help!</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69434.aspx</link><pubDate>Fri, 19 Aug 2011 12:21:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69434</guid><dc:creator>TedCa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69434.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69434</wfw:commentRss><description>&lt;p&gt;Is the slow performance caused by using rich text boxes ?  If so could you switch to text boxes?&lt;/p&gt;</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69384.aspx</link><pubDate>Wed, 17 Aug 2011 20:38:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69384</guid><dc:creator>alexteno</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69384.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69384</wfw:commentRss><description>I&amp;#39;ve had time to do the Section and conditional formatting. Worked brilliantly. I&amp;#39;ll check with Pageing tomorrow (ran out of time today)</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69374.aspx</link><pubDate>Wed, 17 Aug 2011 16:06:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69374</guid><dc:creator>alexteno</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69374.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69374</wfw:commentRss><description>Thanks for that info. I&amp;#39;ll be attempting that later today. I&amp;#39;ll update whether or not that solves the problem =D</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69373.aspx</link><pubDate>Wed, 17 Aug 2011 15:43:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69373</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69373.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69373</wfw:commentRss><description>&lt;p&gt;Ah, I see now.&amp;nbsp; Paging is fairly easy.&amp;nbsp; Add a field called &lt;strong&gt;pageNo&lt;/strong&gt; in your form and add conditional formatting to hide its rows on the condition &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;pageNo&lt;/strong&gt; &lt;em&gt;Is not equal to&lt;/em&gt; floor(count(preceding-sibling::&lt;strong&gt;my:repeatingGroupName&lt;/strong&gt;)) + 1&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;You cannot use code to control the formatting of your form.&amp;nbsp; It&amp;#39;s not possible to change the background color of the entire canvas, but you can place the main part of your form in a large section control, and use conditional formatting to control its color.&lt;/p&gt;</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69372.aspx</link><pubDate>Wed, 17 Aug 2011 15:12:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69372</guid><dc:creator>alexteno</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69372.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69372</wfw:commentRss><description>&lt;br /&gt;Sorry, I may not have made it clear in my first post that I have two separate issues. I&amp;#39;m not trying to format the repeating table, it&amp;#39;s that large repeating tables seem to load very slowly (with many rows).
&lt;br /&gt;
&lt;br /&gt;The other issue (the programming one) I have a checkbox on the form, when it is checked, ideally I&amp;#39;d like to have the background colour of the form change.
&lt;br /&gt;
&lt;br /&gt;I probably should&amp;#39;ve made two topics, that&amp;#39;s my mistake.
&lt;br /&gt;
&lt;br /&gt;To reiterate
&lt;br /&gt;Problem 1: Repeating table with many lines load very slowly.
&lt;br /&gt;Problem 2: Would like to change the background colour of the entire form with either conditional formatting or .NET when a checkbox has been marked.</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69371.aspx</link><pubDate>Wed, 17 Aug 2011 15:04:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69371</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69371.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69371</wfw:commentRss><description>&lt;p&gt;Sorry, I didn&amp;#39;t realize that you were using a repeating table. Repeating tables&amp;#39; conditional formatting is perfectly capable of changing the table&amp;#39;s background.&amp;nbsp; You&amp;#39;d need to modify the conditional formatting on the controls inside it to change their color.&amp;nbsp; You can&amp;#39;t simply switch everything to another color scheme, but you can set up conditional coloring that way.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Would you mind sharing the code in question with us?&amp;nbsp; I&amp;#39;m curious which part of it you believe to be loading everything into memory.&lt;/p&gt;</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69368.aspx</link><pubDate>Wed, 17 Aug 2011 14:30:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69368</guid><dc:creator>alexteno</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69368.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69368</wfw:commentRss><description>I don&amp;#39;t think sections are going to work. The repeating table is just that, a repeating table. There is no separation between line items. I think what I&amp;#39;m looking for is closer to a filter.</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69332.aspx</link><pubDate>Tue, 16 Aug 2011 17:20:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69332</guid><dc:creator>alexteno</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69332.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69332</wfw:commentRss><description>&lt;br /&gt;To elaborate on the Page Thru idea, from what I&amp;#39;ve seen when loading the form (not a webform) it seems to load all of the lines into memory. On slower computers - i.e. the one&amp;#39;s at my organization - it takes anywhere from 15 seconds to 5 minutes to load the form based on how many lines exist in the repeating table. Our longest form to load is roughly 5 minutes with about 237 lines in the repeating table.
&lt;br /&gt;
&lt;br /&gt;I haven&amp;#39;t heard of sections before not, but since I now know what to look for, I&amp;#39;ll investigate and see if it would be useful to solve this problem.</description></item><item><title>Re: Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69331.aspx</link><pubDate>Tue, 16 Aug 2011 17:11:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69331</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69331.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69331</wfw:commentRss><description>&lt;p&gt;I believe you can use &lt;strong&gt;Section&lt;/strong&gt; controls to fill each of your table cells and put conditional formatting on those.&amp;nbsp; Have you tried that?&lt;/p&gt;
&lt;p&gt;Perhaps it&amp;#39;s because I don&amp;#39;t know what your code is doing, but I don&amp;#39;t see how iterating through a repeating section in small bunches would improve the speed.&amp;nbsp; Could you elaborate on that?&lt;/p&gt;</description></item><item><title>Infopath Coding Conditional Formatting and Item Page-Thru</title><link>https://www.infopathdev.com:443/forums/thread/69304.aspx</link><pubDate>Tue, 16 Aug 2011 12:21:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:69304</guid><dc:creator>alexteno</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/69304.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=69304</wfw:commentRss><description>&lt;br /&gt;I&amp;#39;m looking for some help in modifying a form for two purposes.
We would like to use conditional formatting to modify the coloring of a table or of the background, or even to modify the color scheme entirely if a Checkbox has been marked.  Unfortunately, it doesn&amp;#39;t look like there are conditional formatting options to modify regular table options, or to change the colour scheme (that I can find). If anybody knows how to make this happen either through .Net Programmability or some clever conditional formattery, I&amp;#39;d appreciate it.
&lt;br /&gt;
&lt;br /&gt;My second issue, We have a repeating table that slows down with many lines of code, I&amp;#39;ve been searching for threads about this issue, and I know a solution, I just don&amp;#39;t know how to make it happen. Ideally, we&amp;#39;d like to have the items of the repeating table be paged thru (1 - 10, 11 - 20, 21-30, etc...) in order to reduce the load when the form is opening.
&lt;br /&gt;
&lt;br /&gt;Help or links to solutions would be amazing, thanks guys. 
&lt;br /&gt;
&lt;br /&gt;Alex</description></item></channel></rss>