0

wondering how to carry out this requirement if at all possible.

I am modifying the Customer Account Statement morphx report, and the user has requested that we have a Page of Page, i.e. Page 1 of 10, Page 2 of 10 etc etc...

What we need is for the report to reset the total pages after it fetches a new customer. So Customer 00001 might have a 3 page statement, which would be "Page 1 of 3" "Page 2 of 3" and "Page 3 of 3". Customer 00002 might only have a page statement so it will be "Page 1 of 1".

As standard what happens is you get Total pages for the entire report i.e. "Page 1 of 140" "Page 2 of 140" "Page 3 of 140" then next customer "Page 1 of 140" etc etc...

I would assume that a total counter based on the standard counter would be required, but not sure where to capture this total value?

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
will
  • 188
  • 1
  • 4
  • 16

1 Answers1

0

You can call the element.reset() method in fetch after each account statement. This finalizes the report as a print job. This not good if the output is going to a PDF or mail.

Also have a look on this and this question.

Community
  • 1
  • 1
Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
  • Hi Jan, firstly thank you again for your assistance it is as always greatly appreciated. I have added this to the end of the Fetch method and it splits the report up into individual Account Statements, is this the only way that this will work? I understand that when sending straight to a printer this is the ideal method, but if we want to view the report then it means over 100 report viewers opening? – will May 23 '12 at 08:24
  • Unless you can pre calculate then number of pages :). See http://stackoverflow.com/a/10318409/4509 – Jan B. Kjeldsen May 23 '12 at 08:31
  • But if you test on the `this.printJobSettings.getTarget()` you can either `newPage` and set `page` or `reset`. The pageTotal will then not work on sceen. Hopefully they will not print from the screen viewer. These are your options. – Jan B. Kjeldsen May 23 '12 at 08:35
  • I see, many thanks for your assistance. Hopefully they are happy to just go with Page 1, Page 2, Page3 --> next Customer Page 1, Page 2 etc... – will May 23 '12 at 08:56