same label printed more than once

airamairam Member Posts: 88
hey all,

i am new to NAV and i was given the task to create a report with a label layout. but my main concern, and where i got stuck is when i had to loop for the same label a number of times where the quantity is greater than 1. since the amount of labels depends on the quantity of each item. 3 of a product means 3 labels etc.

i found a post on this forum similar to what i need, and the solution was to create an integer dataitem, but i can't do this in my case as the Quantity datatype is decimal since it is being used in other tables which requires the quantity to be in decimal (the quantities in the table i need are all whole numbers, but still in decimal format)

if anyone has another solution please let me know :) much appreciated

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Base your report on a temptable.

    In the OnPreReport-trigger, insert x-number of records per item in your temptable:
    Quantity = 3 -> insert 3 records in your temptable
    Quantity = 1 -> insert 1 record
    Quantity = 0 -> don't insert a record

    Now looping through your temptable, you can print one label per record.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • airamairam Member Posts: 88
    aa okii i try it out and i'll let you know, thanks a lot for your quick reply!!
  • pdjpdj Member Posts: 643
    Why not use the Integer dataitem? Just the OnPreDataItem to set the proper range.
    Regards
    Peter
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • airamairam Member Posts: 88
    thanks a lot Luc Van Dyck, it worked!!
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Great.

    Please mark your topic as solved.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
Sign In or Register to comment.