Reset page number with 2 or more invoices

Hai all… I want to print multiple page once at a time, so it could save time for the user…

for example i want to print invoice 1-3

invoice 1 = page 1-2

invoice 2 = page 1-3

invoice 3 = page 1-2

what should I do if i don’t want to be reseted for the pages…

because my report now like these :

invoice 1 = page 1-2

invoice 2 = page 3-5

invoice 3 = page 6-7

CurrReport.PAGENO → I want to reset page no if the invoice number changed

please give me advice , thanks :slight_smile:

In the section of OnAfterGetRecord of Sales Invoice Header, just reset the page no. by putting the following code…

CurrReport.PAGENO := 1;

In fact, you can look at NAV’s standard invoice. This feature is a standard feature in NAV standard invoices.

it didn’t work…

while change invoice number it still the same page number

invoice 1 = page 1-2

invoice 2 = page 2-4

that shouldwork, unless PAge No. is defined differently in your report.

Refer to the standard Sales Invoice report. In the CopyLoop Dataitem, in OnAfterGetRecord trigger, you can see the code :

CurrReport.PAGENO := 1;

being used to reset the page no.

it works, but i change a little bit your code

CurrReport.PAGENO := 0;

but the Sales line doesn’t change page…

it still continued in the same invoice

What do you mean by the above statement…?

For example I Have 3 invoices

and then I want to print them all

If I print them one by one, it looked perfect

but if I printed them altogether…

so the footer only one… I want to print those 3 invoices with 3 footers

another problem is

I set 1 page = 20 lines

if have in invoice 1 = 19 lines

then it will be invoice 1 = 19 lines and invoice 2 = 1 line

I want to be that invoice 2 in newpage…

how to create new page if invoice is new

refer to the standard sales invoice. normally, I would just modify invoices of from the standard Sales Invoice, as the standard invoice handles all the footers, page nos. and copy numbers beautifully.

As for your 2nd problem… I am not very sure what you mean.

it’s okay then

I already solve the problem

by the way, thanks for the share :))