Count total # of pages in a report

mplatvoetmplatvoet Member Posts: 34
edited 2003-11-20 in Navision Financials
Does anyone have a suggestion how to count the total number of pages of a report so that every page can have the Text:

Page 1 of <TotalPages>, etc.
Many thanks in advance!

Mike.

Comments

  • John_TegelaarJohn_Tegelaar Member Posts: 159
    Mike,

    Navision creates the pages "on-the-fly" without preprocessing, so there's no way to know in advance how many pages the report will take in total.

    Reason for no preprocessing of the reports may be in the fact that reports are also used for many tasks that require no output on screen (i.e. batch processing), which could have hundreds of "pages". Preprocessing in such case would severly decrease speed.

    John
  • SunsetSunset Member Posts: 201
    Although you could of course count the number of lines you are printing on each page, divide into the total number of lines that will be printed (rounding up). This will slow the report down somewhat. If you however don't know how many lines will be printed you will need to make a loop counting the lines before you print, severely slowing down the report
    Don't just take my word for it, test it yourself
  • WalkerWalker Member Posts: 5
    John mentioned that Navision creates the pages "on-the-fly" without preprocessing, does it mean we can't control how many line per page to print on each page?

    I am now modifying the Purchase Order Report and I would like to increase the no. of line to print on each page. Is it possible?

    Please kindly share your experience. Thanks!
  • StephenGStephenG Member Posts: 99
    Hi

    First thing you need to remember is that Navision reserves space for each of the Sections included in the report Dependent on the properties set(ie PrintOnEveryPage or KeepWithNext).

    One way to get a few extra lines to print on a page is to Change the Report properties 'TopMargin' and 'BottomMargin' , I usually do that when I create Landscape reports.
    Answer the question and wait for the answer.
  • DoomhammerDoomhammer Member Posts: 211
    @sunset: question - how do you imagine to calculate no of lines printed on page in more complex report? In example, when you using page breaks when grouping, then on every individual page can be different count of lines.
    Your idea sounds too complicated to me.

    My idea: What about using sections type TransFooter and Footer to calculate no of printed pages. SectionHeight of this "control section" can be 0, so this added section should not reserve space for itself (I hope so, report generator in Navision Financials/Attain is in some cases still mysterious for me, even after two and half year programming within Navision world; section dependencies in printed outputs are one of these mysteries :-)). Of course, page count can be printed on last page. Am I right?
    But... wait... How can I determine that I am on last page? :?: :!: :?: This problem is more complicated than I supposed. I showed you possible way, but I'm unable to complete solution. :-) Whoops. What are you thinking?

    Another idea for simple reports working on one table without any page breaks: try to calculate no of lines per page, then use COUNT function to determine count of records, which shall be printed via report and divide COUNT / NoOfLinesPerOnePage :wink: and you should get no. of pages.
    Martin Bokůvka, AxiomProvis
  • nymannyman Member Posts: 19
    What about runnint once report without printing and then run report again already knowing pages number ?

    Dirty, I know, but it should work ...
    There is no way to Linux. Linux is the way !
Sign In or Register to comment.