//setLog("$conteo--" . $cont[$conteo]);
            $xCampo = new cReportes_LayoutTipos($propiedades, $cont[$conteo], $xLayout->getSeparador());
            $msg .= $preguntar == false ? $xCampo->getMessages(OUT_HTML) : $xCampo->getMessages(OUT_TXT);
            $cont[$conteo] = $xCampo->get();
            //setLog($conteo . "---" . $xCampo->get());
            $errors += $xCampo->ERRORES;
            $totalerrores += $errors;
        }
        $conteo++;
    }
    foreach ($cont as $t => $k) {
        $linea .= $linea == "" ? $k : $delimitador . $k;
    }
    $rpt .= $linea . "{$delimitador}\r\n";
    $css = $errors > 0 ? " class='error'" : "";
    $xHTable->addRow($cont, "td", $css);
    //$orels++;
    $operaciones++;
}
$errors = $msg == "" ? false : true;
if ($preguntar == true) {
    header('Content-type: application/json');
    $arr = array("mensajes" => $msg, "registros" => $operaciones, "errores" => $totalerrores);
    echo json_encode($arr);
} else {
    if ($production == true and $errors == false and $operaciones > 0) {
        $archivo = $xLayout->getClave() . $xT->cSerial(6, $casfin) . $FechaTitulo . "." . $xT->cSerial(3, $supervisor);
        //header("Content-type: text/x-csv");
        header("Content-type: text/plain");
        //header("Content-type: application/csv");
        header("Content-Disposition: attachment; filename={$archivo}");