How to count report pages in pre-rendered MorphX report?

谁都会走 提交于 2020-01-04 04:33:28

问题


We are trying to force a morphX report to be an even number of pages in length (so our auto-folding machine can handle the workload properly) and have been unsuccessful in using element.pagesTotal() to do so.

How have others gotten a page count for per-entity reports at the element level?

(this is dynamics ax 2009)


回答1:


Sorry, but pagesTotal is a "magic" function that delivers the result after the report has finished, which is too late for you to emit a newPage.

You will have to count yourself. Luckily X++ is quite good at it!

Declare your counter in classDeclaration:

 Counter pc;

Increment your counter in a page header execute section:

 pc++;

In fetch add your newPage after super() (or on break of customer number):

boolean fetch()
{
    boolean ret = super();
    if (pc mod 2 == 1)
        element.newPage();
    return ret;
}


来源:https://stackoverflow.com/questions/14590986/how-to-count-report-pages-in-pre-rendered-morphx-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!