SELECT c_karty, nazev, cena01 as pc01, cena09 as pc09, kod as serial_no ;
       FROM (fn_karty) INTO CURSOR buffer READWRITE 

SET ORDER TO c_karty IN karty
CREATE CURSOR stitky_k_tisku (nazev1 C(30), nazev2 C(30), serial_no1 C(15), serial_no2 C(15), cena1_1 Y, cena1_2 Y, cena9_1 Y, cena9_2 Y, c_karty1 I, c_karty2 I)
pocitadlo = 0
SELECT buffer 
SCAN
   SCATTER FIELDS nazev, serial_no, pc01, pc09, c_karty MEMVAR 
   SELECT stitky_k_tisku
   IF m.pocitadlo % 2 = 0
       APPEND BLANK 
       REPLACE nazev1 WITH m.nazev, serial_no1 WITH m.serial_no, cena1_1 WITH m.pc01, cena9_1 WITH m.pc09, c_karty1 WITH m.c_karty
   ELSE
       REPLACE nazev2 WITH m.nazev, serial_no2 WITH m.serial_no, cena1_2 WITH m.pc01, cena9_2 WITH m.pc09, c_karty2 WITH m.c_karty
   ENDIF 
   pocitadlo = m.pocitadlo + 1
ENDSCAN 
SELECT stitky_k_tisku
DO pr_report WITH "stitky_zbozi_regal"
USE IN stitky_k_tisku
