Print a range of Order Pick Tickets

Using NAV 5.0 but do not have any of the Warehouse granules. My warehouse people use Sales Order Shipping to post their daily shipments. To print an Order Pick Ticket, they use a link that I created in the NAV pane to report 25001 and filter on the order number they are working on.

They would like to be able to print a range of Pick Tickets instead of printing them one at a time. I thought we should be able to use the standard range filter to do this, ie. SO-1…SO-10 but when I tried this, the Sales Header for the first record printed on all of the pages of the report even though the body of the report was looping correctly.

NewPagePerRecord=Yes

PrintOnEveryPage=No

I set PrintOnEveryPage to Yes and the different record Sales Headers did start showing up. The lingering problem is: The Sales Header from the first record prints twice such that pages 1 and 2 (orders SO-1 and SO-2) have the same header. In other words, the second Pick Ticket also shows as SO-1 even though the body is correctly displaying for SO-2. The end result is that each subsequent Order Pick Ticket incorrectly displays the Header information for the previous record.

How can I stop the first record Header from repeating?

Bump. Anyone have any ideas?

I am newbie in this field. I think you ask this question form Google. It gives you the best solution.

Naturally, I googled this question and read all of the related posts in this forum and mibuso. If you have found an answer in a regular search engine, perhaps you could be kind enough to post a link.

Hi,

You will not be able to overcome this issue only with changing report properties. You will have to place some code on the “OnAfterGetRecord” and on the “OnPreSection” trigger.

I suggest do the following:

  1. create a global variable same type the field you are filtering (for example: SalesHeaderNum)

  2. in the table header “OnPreSection” trigger save the sales header number in that variable.

  3. finally, on the “OnAfterGetRecord”, compare the value in that variable with the current record. If they have the same value then CurrReport.SKIP.

This might work because, as you described, both values are equal only in the first record read. But sometimes you need to do some more validation.

Try this and tell me what happened.

I find the easiest way to do this is to add a new data item. So you would have something like

SalesHeaderFilteringDataItem (No sections, just required filter fields)
Sales Header linked to the above (Sections, no required filter fields)

It’s quick and painless to do it that way. Your first data item is used so that the user can type in filters, like the range of orders. It loops through that range and does everything it normally would for each order. Hope that makes sense.

That’s the best way to solve the problem…

Why didn’t I thought of that! [:D]

That’s very clean and makes sense to me with my limited understanding of this report writer. However, am I wrong in thinking that your cannot define the Sales Header table as a data item twice?

This is my interpretation of your advice:

Data Item: Sales Header

Req. Filter Fields: No.

DataItemVarName: HeaderFilter

Data Item: Sales Header

DataItemLinkReference: HeaderFilter

DataItemLink: No.=FIELD(No.)

You can. You just have to change the default name it gives it. Take that report as an example, the Data Item is Integer, but the name is PageLoop.

OK. I didn’t realize I could type over that. Did that and got the report to compile but it is still duplicating first header on page 2.

I like your signature and I’m all for teaching a man to fish but if you give me a fish, I promise you I will dissect and analyze it and figure out the best way to catch it myself next time. :smiley:

There are several things you can check / do.

  1. Is Print on Every Page property turned on for that section?

  2. Move it do a different section, say a Header section on your new Sales Header data item.

  3. Control is with SHOWOUTPUT and only show it when the page number is 1.