Call LabelView From C\Side Nav

Simo_baSimo_ba Member Posts: 78
Hi,
i need to call LabelView from C\side as an Automation, but im confused, i need to pass parametre to print my specefic Label with dynamic Data.
Any suggestions are wellcome
Thanks a lot
Simo.

Comments

  • ara3nara3n Member Posts: 9,256
    here is an example

    LabelDoc is automation
    LabelFields is automation
    LabelField is automation
    LabelApp is automation
    LabelPrinter is autmation
    IF  ISCLEAR(LabelDoc) THEN
      CREATE(LabelDoc);
      LabelLocation := 's:\lvwin60\LBL\cpt3.lbl'
    
      LabelDoc.Open(LabelLocation);
      LabelFields := LabelDoc.LabelFields;
    
    
      /// the 'BILL_TO'   etc are fields in your label file. Make sure you give them value.
    FOR i := 0 TO LabelFields.Count -1 DO BEGIN
      LabelField := LabelFields.Item(i);
      CASE LabelField.Name OF
        'BILL_TO': LabelField.Value("Sales Header"."Sell-to Customer Name");
        'ITEM_UPC': LabelField.Value(repupc);
        'CUST_SKU': LabelField.Value(PrePricing."Customer Item No.");
        'ITEM_DESC1': LabelField.Value(ItemRec.Description);
        'RET_PRICE': LabelField.Value(STRSUBSTNO('$%1',FORMAT(PrePricing."Unit Price",0,'<Precision,2:2><Standard Format,0>')));
        'VOLUME':  LabelField.Value(repvol);
      END;
    END;
    
    
    LabelPrinter := LabelDoc.LabelPrinter;
    LabelPrinter.Name('TEC B-572');  //printer name
    
    
    LabelDoc.PrintLabel(1);   //1 is number of times  you want to print
    CLEAR(LabelDoc);
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Simo_baSimo_ba Member Posts: 78
    =D>
    THANK YOU RASHED
  • ara3nara3n Member Posts: 9,256
    You are welcome.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.