Search code examples
genexus

Indicate a subtotal of pages in a PDF report on Genexus


I need to create some documents in Genexus indicating the number of pages for each document separately To clarify better, I need to create a 6-page report in which the first 2 belong to one document and the remaining 4 to another At the moment, thanks to the &Page variable and the {{Pages}} command (for which I can't find any documentation, I only know that it was suggested to me many years ago) I can indicate the ratio between the current page number and that of total pages

1 / 6
2 / 6
...
6 / 6

I would need though if there is a way to have a subtotal so that the two documents have the totals shown separately. I would like to get this type of numbering

1 / 2
2 / 2

1 / 4
2 / 4
3 / 4
4 / 4

I can manually reset the Page variable, but I don't know how to do it for the total number of pages, I can't even calculate it in advance. Is there a way to solve this, perhaps with other commands similar to {{Pages}} ? Where can I find documentation on these?


Solution

  • Although not efficient, I found two solutions: one is to generate the files separately and merge them via a user control, another is to generate them separately as "temporary files", receive the length of the document as an output parameter (the &Page variable) and use this parameter as a total for the corresponding section. Then I delete the temporary file.

    Pretty crude, but it worked