Page X of Y for Sales Invoice in NAV 2013 Error-Question

LilithyanLilithyan Member Posts: 32
edited 2014-04-08 in NAV Three Tier
Hi Everybody,

so... I've been browsing the web and have been experimenting some myself to get a that problme of printing "Page X of Y" in the sales invoice solved. So far no luck sadly. But I did stumble over something that I didn't quite understand. Maybe it's just me still being in a func about getting booted out of my apartment after living only six months in it and having to find a new one in the next two and a half months. Anyway...

I had a thought about the main problem here, that being the TotalPages, which usually gives out the wrong value if you print one or more copies of an invoice or more than one invoice at a time. And I thought to myself: "Okay, if I go by the assumption, that only one invoice is printed at a time, but with an x amount of copies, can't I get the last value of the OutPutNo and divide the TotalPages through that?"

Rudementary example of my thought-process from above: Globals!TotalPages / Last(Fields!OutPutNo.Value). (for the second value actually a code.getdata, because it being in the Header and all that).

So I had the thought it would either work or not. The way I tried it didn't work but I don't understand the (wrong) value it prints. Insted of something like #Error I get "unendlich", which is the german word for infinite as I'm German and thus develope on a System with the base language being German.

Any idea just why I get that kind of error? Because I can't currently make either heads or tails of it.

Ciao,

Lilithyan

PS:I just tried it with the value in NoOfLoops, which the CopyLoop DataItem uses to find out how many prints there are (NoOfLoops := ABS(NoOfCopies) + 1;), but got the same result.

Comments

  • ramesh_bkramesh_bk Member Posts: 1
    pls use the below code in separate text box to get the total no of pages for each copy

    =iif(First(Fields!NoOfCopies.Value, "DataSet_Result") <> 0,Globals!TotalPages / (First(Fields!NoOfCopies.Value, "DataSet_Result") + 1),Globals!TotalPages)

    in preview u wil get wrong total but in print preview u wil get correct
Sign In or Register to comment.