Page 1 of 1

Call to undefined method rowExport()

Posted: Sun May 26, 2024 2:09 am
by jjarambur

Error
...models\Experiencias.php(1309): Call to undefined method PHPMaker2024\proyectocertificados\ExperienciasList::rowExport()

Script

function Row_Export($doc, $rs)
{
    if ($this->isExport("pdf")) {
        // Obtener los valores de los campos
        $trabajador = $rs['trabajadores'];
        $cargoNombre = $rs['cargoNombre'];
        $fechaInicio = $rs['fechaInicio'];
        $fechaFin = $rs['fechaFin'];
        $funciones = $rs['funciones'];

        // Construir el contenido personalizado
        $content = "La empresa xxxx certifica a {$trabajador}, el cual trabajó desde el {$fechaInicio} hasta el {$fechaFin} en el cargo {$cargoNombre} con las siguientes funciones:";
        $content .= "<ul>";
        $content .= "<li>{$funciones}</li>";
        $content .= "<li>{$funciones}</li>"; // Añade más funciones si es necesario
        $content .= "</ul>";

        // Agregar el contenido al documento PDF
        $doc->Text .= $content;
    }
}

Re: Call to undefined method rowExport()

Posted: Sun May 26, 2024 2:52 pm
by arbei

Where did you put above script? Make sure you put it under "Row_Export" server event and not elsewhere.

Make sure you also use Page_Exporting and return true to use "Row_Export" server event. Read the docs for details.

After adding server event make sure you generate all scripts for that table again.