import glob
import os
import xml.etree.ElementTree as ET

for f in sorted(glob.glob('C:/GESTIGEST/reportes/*.fr3')):
    try:
        tree = ET.parse(f)
        root = tree.getroot()
        barcodes = list(root.iter('TfrxBarCodeView'))
        if barcodes:
            fname = os.path.basename(f)
            print(f'=== {fname} ===')
            for b in barcodes:
                name = b.get('Name')
                btype = b.get('BarType')
                df = b.get('DataField')
                expr = b.get('Expression')
                txt = b.get('Text')
                print(f'  - {name}: BarType={btype}, DataField={df}, Expr={expr}, Text="{txt}"')
    except Exception as e:
        pass

