{"id":179,"date":"2007-09-11T07:37:00","date_gmt":"2007-09-11T07:37:00","guid":{"rendered":"\/lisa\/post\/2007\/09\/11\/A-small-present-for-Ludek-RunReports-revision.aspx"},"modified":"2007-09-11T07:37:00","modified_gmt":"2007-09-11T07:37:00","slug":"a-small-present-for-ludek-runreports-revision","status":"publish","type":"post","link":"https:\/\/spacefold.com\/lisa\/2007\/09\/11\/a-small-present-for-ludek-runreports-revision\/","title":{"rendered":"A small present for Ludek: RunReports revision"},"content":{"rendered":"<p>\nI <a href=\"\/lisa\/2007\/08\/06\/PDF-Power-Redux-Redacted-and-Reduced\/\" title=\"Info about RunReports in re PDFListener\">mentioned<\/a> that _ReportListener&#39;s .RunReports method contained a private array member property holding&nbsp;page information, with the idea that running a collection of reports and all the pagination options, old and new, available in VFP might deserve some customized handling.&nbsp; It was just stubbed in, originally, in the hopes that somebody, somewhere, would get the idea that this took work of a non-generic (trans: non-shippable) nature, but still worth doing.\n<\/p>\n<p>\nIn SP2,&nbsp;the contents of the array&nbsp;will be a bit easier for users to customize, and a bit more useful even in the base _ReportListener representation &#8212; so the member is now marked PUBLIC.&nbsp;\n<\/p>\n<p>\nThe array is&nbsp;easier to customize because .RunReports calls a hook method, .adjustReportPagesInfo(m.tiReportIndex, m.tcClauses, m.toListener), to adjust the array contents on each report pass during a .RunReports processing action. It&#39;s more useful in the base (I hope) because it is adjusted to two-dimensional contents by this method, and filled with a report-specific last page number in the first element and a cumulative report run total in the second element.\n<\/p>\n<p>\nAs the comments in the new method will indicate, <em>this implementation is still a sketch<\/em>.&nbsp; There are lots of other ways you might decide to handle pagination for a multi-report page run, depending on whether you&#39;re using NORESET, NOPAGEEJECT, one listener, multiple listeners, mixed runs with some listeners and some non-object-assisted old-style reports&#8230; all of which .RunReports allows you to do.\n<\/p>\n<p>\nHave at it, with my blessings.\n<\/p>\n<h5>What&#39;s it for?<\/h5>\n<p>\nIf you have a properly-scoped instance of _ReportListener running your reports (note: I did not say serving as the OBJECT reference for each report, I&#39;m talking about the listener with the .RunReports method!) you can get a look at the contents of this collection afterwards and&#8230; do what with it? Well, for one thing, you could do a custom preprocess run, setting listenertype to -1 for your object reference listeners, with great performance and full pagination information at your disposal for a second, displayable run.&nbsp;\n<\/p>\n<p>\nIf <a href=\"\/lisa\/2007\/08\/11\/Reporting-Convergences-Chapter-The-one-about-multiple-sets-of-printing-instructions\/\" title=\"blog post on reports as document sections\">a report is truly a document section<\/a>, you can think of each report as a custom page number set (&quot;reset on group&quot;, where each report in the run is a group, even though there is no group expression involved).&nbsp; If (again) your _ReportListener instance is properly scoped, you can reference this collection for custom <strong>Page X of Y this section, Page A of B total<\/strong> report behavior.\n<\/p>\n<p>\nLudek was using PDFListener (which, by default, uses old-style reporting); the array will give him some access to per-report page totals that will be more consistent between old- and new- style REPORT FORM commands, even in its sketchy_ReportListener default implementation:\n<\/p>\n<p><font face=\"Courier New\" size=\"2\"><\/p>\n<p class=\"code\">\n<br \/>\n<font face=\"Courier New\" size=\"2\" color=\"#0000ff\">&nbsp;&nbsp; IF ISNULL<\/font><font face=\"Courier New\" size=\"2\">(m.toListener) <br \/>\n<\/font><font face=\"Courier New\" size=\"2\" color=\"#0000ff\">&nbsp;&nbsp; &nbsp; THIS<\/font><font face=\"Courier New\" size=\"2\">.reportPages[m.tiReportIndex,1] = <\/font><font face=\"Courier New\" size=\"2\" color=\"#0000ff\">_PAGENO<br \/>\n&nbsp;&nbsp; ELSE <br \/>\n&nbsp;&nbsp; &nbsp; THIS<\/font><font face=\"Courier New\" size=\"2\">.reportPages[m.tiReportIndex,1] = m.toListener.<\/font><font face=\"Courier New\" size=\"2\" color=\"#0000ff\">PageNo <br \/>\n&nbsp;&nbsp; ENDIF<\/font>\n<\/p>\n<p><\/font><\/p>\n<h5>&nbsp;&nbsp;<\/h5>\n<h5>But wait there&#39;s more&#8230;<\/h5>\n<p>\nSP2 is also shipping with a new class called fxResetPageTotal, which handles similar chores for the &quot;reset on group&quot; pagination improvements in a single report. But that&#39;s another post.\n<\/p>\n<h5>Did you think other people got this in-the-box?<\/h5>\n<p>\nHow do you suppose you do this same stuff in Reporting Services reports?&nbsp; That&#39;s <em>definitely<\/em>&nbsp;another post.\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I mentioned that _ReportListener&#39;s .RunReports method contained a private array member property holding&nbsp;page information, with the idea that running a collection of reports and all the pagination options, old and new, available in VFP might deserve some customized handling.&nbsp; It was just stubbed in, originally, in the hopes that somebody, somewhere, would get the idea<a class=\"more-link\" href=\"https:\/\/spacefold.com\/lisa\/2007\/09\/11\/a-small-present-for-ludek-runreports-revision\/\">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":[5,9],"tags":[],"class_list":["post-179","post","type-post","status-publish","format-standard","hentry","category-reporting","category-visual-foxpro"],"_links":{"self":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/179","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=179"}],"version-history":[{"count":0,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/posts\/179\/revisions"}],"wp:attachment":[{"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/media?parent=179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/categories?post=179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spacefold.com\/lisa\/wp-json\/wp\/v2\/tags?post=179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}