Report Question

SteveSteve Member Posts: 81
I created a table that contains the number of labels need to be printed. The data is as follows

Entry No , Item No, Decsription, Qty. to Print
1 , 0001 , Item1 , 3
2 , 0002 , Item2 , 2
3 , 0003 , Item3 , 6

I have a label report that has 7 labels wide and I need to print the items above into thise report. So the first row of labels would have

Positions
1 2 3 4 5 6 7
0001 0001 0001 0002 0002 0003 0003 <- row 1
0003 0003 0003 0003 <- row 2

Is this possible? I was able to do the prinitng when its a 1 table line per postion, but I haven't figured out how to reprint the same item multiple times.

Hope this makes sense.

Thanks
Steve

Comments

  • garakgarak Member Posts: 3,263
    edited 2008-10-18
    Here a simple / easy solution (cost 5 minutes).
    The report use as DataItem INTEGER. Before the Dataitem is running, we store the Datas from your Label table to a temporary table (here table 32, you can use your own with 7 Text coloumns of lenght 20).
    OBJECT Report 50000 LabelTest
    {
      OBJECT-PROPERTIES
      {
        Date=17.10.08;
        Time=07:09:32;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table2000000026;
            DataItemTableView=SORTING(Number);
            OnPreDataItem=BEGIN
                            LabelTest.RESET;
                            LabelTest.SETFILTER("Qty. to print",'>%1',0);
                            LabelTest.SETFILTER("Item No.",'<>%1','');
                            IF LabelTest.FINDSET(FALSE,FALSE) THEN BEGIN
                              REPEAT
                                TempTab.INIT;
                                TempTab."Entry No." := LabelTest."Entry No.";
                                FOR i := 1 TO LabelTest."Qty. to print" DO BEGIN
                                  CASE i OF
                                    1: TempTab."Item No." := LabelTest."Item No.";
                                    2: TempTab."Source No." := LabelTest."Item No.";
                                    3: TempTab."Document No." := LabelTest."Item No.";
                                    4: TempTab.Description := LabelTest."Item No.";
                                    5: TempTab."Global Dimension 1 Code" := LabelTest."Item No.";
                                    6: TempTab."Global Dimension 2 Code" := LabelTest."Item No.";
                                    7: TempTab."External Document No." := LabelTest."Item No.";
                                  END;
                                END;
                                TempTab.INSERT;
                              UNTIL LabelTest.NEXT = 0;
                            END;
    
                            TempTab.RESET;
                            SETRANGE(Number,1,TempTab.COUNT);
                          END;
    
            OnAfterGetRecord=BEGIN
                               IF (Number = 1) THEN
                                 TempTab.FIND('-')
                               ELSE
                                 TempTab.NEXT;
                             END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=13500;
                SectionHeight=423;
              }
              CONTROLS
              {
                { 1119402000;TextBox;0    ;0    ;1800 ;423  ;HorzAlign=Right;
                                                             SourceExpr=TempTab."Item No." }
                { 1119402001;TextBox;1950 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                             SourceExpr=TempTab."Source No." }
                { 1119402002;TextBox;3900 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                             SourceExpr=TempTab."Document No." }
                { 1119402003;TextBox;5850 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                             SourceExpr=TempTab.Description }
                { 1119402004;TextBox;7800 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                             SourceExpr=TempTab."Global Dimension 1 Code" }
                { 1119402005;TextBox;9750 ;0    ;1800 ;423  ;HorzAlign=Right;
                                                             SourceExpr=TempTab."Global Dimension 2 Code" }
                { 1119402006;TextBox;11700;0    ;1800 ;423  ;HorzAlign=Right;
                                                             SourceExpr=TempTab."External Document No." }
              }
               }
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=9020;
          Height=3410;
        }
        CONTROLS
        {
        }
      }
      CODE
      {
        VAR
          LabelTest@1119402001 : Record 50001;
          TempTab@1119402000 : TEMPORARY Record 32;
          i@1119402002 : Integer;
    
        BEGIN
        END.
      }
    }
    

    So, thats a very simply examle.

    An other way is to use a array[7] and a sepereate (then 2) DataItems

    -Label Item
    ---Integer <- here filling the Array[7] (for i := 1 to Qyt. do begin Array := "Label Item"."Item No." end) and filter this DataItem for the Qyt.

    Regards
    Do you make it right, it works too!
  • SavatageSavatage Member Posts: 7,142
    I think array is the way to go too. Garak it would be great if you edited your post to use the (CODE) thing - then they can just hit the copy code button :D
  • garakgarak Member Posts: 3,263
    Your wish is my command. :wink:
    Do you make it right, it works too!
Sign In or Register to comment.