Report displaying serial numbers

Hi, need to tap into some Navision geniuses… We’re programming a serial number printing scheme on reports. Since most of the serial numbers are in sequence, they can get away with using ‘-’ to annotate a sequence. However, if there’s a gap between the serial numbers, they want it in a new line. So for example, if the serial numbers are the following: A23450 A23451 A23452 A23453 A23454 123521 123522 123535 The report will display: A23450 - A23454 123521 - 123522 123535 The customer sells hundreds of items with serial numbers for a particular item, so it doesn’t make sense to list it out one by one. Any help would be greatly appreciated!

Have a look at the INCSTR function (sorry, it’s late so I’m not going to elaborate)

Yeah, we know about the INCSTR function. The most efficient code we came up with was along the line of: 1. Find the first SN entry 2. Do INCSTR until the next SN No. doesn’t match 3. Then concatenate the field for the first SN entry to the last matched SN No. 4. Set the record to the next SN Entry 5. Repeat until next = 0 Just want to get different ideas on how to proceed

Sounds quite logical really. But maybe you shouldn’t have posted your current solution, it will influence other people’s thoughts. [;)]

You will also need a temporary table to insert the results into prior to prininting, this will be easier than doing it on the fly.

Temporary table? Can you please elobrate on the usage of a temporary table in this case?

quote:

Sounds quite logical really. But maybe you shouldn’t have posted your current solution, it will influence other people’s thoughts. [;)]
Originally posted by nelson - 2005 Dec 13 : 00:18:50

Duh! Didn’t mean to do that… Just wanted to float some ideas around really…

Its always hard to calculate exact text lengths positions counters etc. Much easier is to define a temproary variable, and populate this with the lines you want to print, and then print from that.