php-excel-templator icon indicating copy to clipboard operation
php-excel-templator copied to clipboard

too many rows

Open disney1993 opened this issue 4 years ago • 4 comments

I am generating an excel and in the parameters I pass an array with 60 items but the excel is generated with approximately 500 unnecessary rows my code: `$academicperiods = Academicperiod::where('status', 'Vigente')->firstOrFail(); $periodname=$academicperiods->period_name; $periodcode = $academicperiods->period_code; $finalperiodname='ASIGNATURAS A APERTURARSE EN EL PERÍODO '.$periodname.' ('.$periodcode.') '; //ASIGNATURAS A APERTURARSE EN EL PERÍODO MARZO 2020 - JULIO 2020 (SI-2020)

        $params = [
            '{period}'=>new ExcelParam(CellSetterStringValue::class, $finalperiodname),
            '[subjectgrade]' => new ExcelParam(CellSetterArrayValue::class, $subjectgrade),
            '[subjectdepartment]' => new ExcelParam(CellSetterArrayValue::class, $subjectdepartment),
            '[subjectname]' => new ExcelParam(CellSetterArrayValue::class, $subjectname),
            '[subjectcredits]' => new ExcelParam(CellSetterArrayValue::class, $subjectcredits),
            '[total]' => new ExcelParam(CellSetterArrayValue::class, $total),
            '[spaces]' => new ExcelParam(CellSetterArrayValue::class, $spaces),
            '[observations]' => new ExcelParam(CellSetterArrayValue::class, $observations)
        ];

        $saveAs = 'storage/files/3/Proyecciones de Matrícula/ReporteProyecciónMatrícula.xlsx';

        PhpExcelTemplator::saveToFile($documentTemplate, $saveAs, $params);`

all the arrays have 60 items but my excel is exported with 500+-

disney1993 avatar Aug 29 '20 05:08 disney1993

I am also facing the exact same issue, someone please helpppppp ! ! ! @alhimik1986

shubhamt619 avatar Aug 31 '20 09:08 shubhamt619

Are there any solutions? @alhimik1986

Artanisky avatar Nov 06 '21 03:11 Artanisky

@Artanisky Please, attach the template.xlsx, some data and code. I can't reproduce the bug.

alhimik1986 avatar Nov 07 '21 11:11 alhimik1986

ithik the name parameter is buggy if param name [date1] and [date11] it will insert both of them, try using very unique param name

wahyuam avatar Jun 27 '22 09:06 wahyuam