3 Replies Latest reply: Jan 29, 2013 8:25 PM by User9976634-Oracle RSS

    How can we find the count of pages generated by a form?

    biswajit1
      Hi,

      I need to know, if there is any possible way I can be able to count the number of pages generated/created by a form dynamically for each policy record in extract file input.

      For each record in extract file (flat file) based input to DAP, if suppose say 3 different forms are triggered I want to find out the number of pages created by each of these forms in run time and save the result to output file like,
      Example -
      Policy 1
      XYZ.FOR 2
      ABC.FOR 3
      PQR.FOR 1

      Policy 2
      MNO.FOR 1
      NSP.FOR 2

      Policy 3
      ...

      Thanks,
      Biswajit Mishra

      Edited by: user11686052 on Jan 29, 2013 2:14 AM
        • 1. Re: How can we find the count of pages generated by a form?
          893077
          Hi Biswajit

          The DALs - TotalSheets() and TotalPages() can be handy.

          Other expensive way is to place a distinctive variable in evey form (use 'copy on overflow' here).
          You can extract the value using the builtin DAL function - count()

          regards
          Navin
          • 2. Re: How can we find the count of pages generated by a form?
            biswajit1
            Hi Navin,

            Thanks for the post!!!

            The DAL function Totalpages() and Totalsheet() functions operate only on recipient names as input. I tried it earlier but it returns total page count per recipient.

            On the other hand using the count() requires to code a variable in each and every form is something I would take as a contingent approach as it may cause regression in base. Not sure if it will work for this scenario but still I will give it a try and update you.

            Thanks again,
            Biswajit
            • 3. Re: How can we find the count of pages generated by a form?
              User9976634-Oracle
              You are correct that the TotalSheets and pages function are counting what actually prints, which can be different than logical pages - assuming that is what you want.
              For what you describe, you might need to use a combination of While loops. The outer loop would use FormName to index through the forms by passing the count as the first parameter. The inner loop would then call the PageImage() function with an index parameter in much the same way and pass the form name from the outer loop. When you get no name back, then you know you have requested an invalid page, so you can know what the count is. With a simple DFD to define you output file, you can then output the name and page count and fall back to the outer loop for the next form.