{"id":155,"date":"2007-11-10T13:50:00","date_gmt":"2007-11-10T13:50:00","guid":{"rendered":"\/lisa\/post\/2007\/11\/10\/FXResetPageTotal-docoid-up.aspx"},"modified":"2021-08-30T14:48:33","modified_gmt":"2021-08-30T21:48:33","slug":"fxresetpagetotal-docoid-up","status":"publish","type":"post","link":"https:\/\/spacefold.com\/lisa\/2007\/11\/10\/fxresetpagetotal-docoid-up\/","title":{"rendered":"FXResetPageTotal docoid up"},"content":{"rendered":"<p>[Please reference <a title=\"VFP-TMM introductory post\" href=\"\/lisa\/2007\/10\/17\/What-LSN-was-Not-Allowed-to-Do-What-LSN-Plans-to-Do-About-It-Now-and-What-You-and-I-Will-Never-Call-It\/\">this post<\/a> if you\u00a0have not previously read about VFP-TMM.]<\/p>\n<p>I decided to reward myself with a little fun after working on the <a title=\"FXListener - TMM\" href=\"\/articles\/tmm\/tmm-fxlistener\">FXListener<\/a> monster today&#8230; so I am pleased and proud to be introducing <a title=\"FXResetPageTotal - TMM\" href=\"\/articles\/tmm\/tmm-fxresetpagetotal\">FX Group Reset PageTotal Implementation<\/a>\u00a0to you tonight. This little class is so simple that the blog post I&#8217;m writing right now may be longer than the docoid.\u00a0 It&#8217;s so useful that it was literally the first reportlistener extension I ever wrote.<\/p>\n<p>FXResetPageTotal\u00a0is a VFP 9 Reporting System-specific implementation of the Reset-On-Group pagination scenario.\u00a0\u00a0This one is\u00a0a classic for reporting engines, and\u00a0I&#8217;ve <a title=\"Blog post on Reset Page Total for SQL RS\" href=\"\/lisa\/2007\/09\/15\/Reset-On-Group-(Page-X-of-XX-in-a-group-within-a-total-Y-of-YY-for-the-report)-SQL-Reporting-Services-Style-\/\">discussed in a Reporting Services context elsewhere in this blog<\/a>.<\/p>\n<p>I wrote it fairly early during the RTM cycle, as soon as we realized that we could make TwoPassProcess readwrite. It was clear that Xbase code was going to be a lot more efficient at keeping track of multiple page numbers by group,\u00a0considering the possibility of thousands of groups,\u00a0than native code would be. (It uses a smartly-indexed cursor in the FRXDataSession, natch.)<\/p>\n<p>There was no way we were going to find a way to get _PAGETOTAL to be less dumb than it is, and we knew this was something people would really want to do.<\/p>\n<p>Whoa, wait a second.\u00a0 Did I just say &#8220;during the RTM cycle&#8221;?\u00a0 You bet.\u00a0 The code in fxResetPageTotal, which is pretty sweet and actually pretty hard to figure out, was written originally\u00a0as a reportlistener implementation.<\/p>\n<p>Towards the end of the RTM cycle, when I was working out the FX subsystem idea and putting it into the RTM docs, I turned it into an\u00a0FX object in less than an hour.\u00a0 All the hard work had already been done, and I barely had to change a line of code.<\/p>\n<p>I hope that makes you look at your own reportlistener extensions with a new perspective.\u00a0 Which ones are really output-generating, and which are decorations for output?\u00a0 You can turn the second\u00a0group\u00a0into FX and GFX objects with very, very little work. You can share them and mix and match for reporting needs much easier than you could do the same thing with monolithic reportlisteners.\u00a0\u00a0You can have all the benefits of multiple inheritance without the feeling that you need to\u00a0decontaminate yourself afterwards.<\/p>\n<p>Go on and give it a try.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Please reference this post if you\u00a0have not previously read about VFP-TMM.] I decided to reward myself with a little fun after working on the FXListener monster today&#8230; so I am pleased and proud to be introducing FX Group Reset PageTotal Implementation\u00a0to you tonight. This little class is so simple that the blog post I&#8217;m writing<a class=\"more-link\" href=\"https:\/\/spacefold.com\/lisa\/2007\/11\/10\/fxresetpagetotal-docoid-up\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-vfp-tmm"],"_links":{"self":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":3,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":422,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/155\/revisions\/422"}],"wp:attachment":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}