• I’ve made some formulas using ‘Custom php to modify output’
    In
    add_action( ‘woe_xls_print_footer’, function ($objXls,$formatter) {}
    I’ve used
    $sheet->setCellValue( “G”. ($row+2), “=SUMIF(L4:L$row;23;G4:G$row)”);

    But in exported excel sheet it appeared as Error508 until user manually edited formula (adding space and removing worked)
    According to docs https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#write-a-formula-into-a-cell I’m supposed to use setCellValueExplicit but using:

    $sheet->setCellValueExplicit( “G”. ($row+1), “=SUM(G4:G$row)”, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);

    throws error:

    PHP Fatal error: ?Uncaught Error: Class “PhpOffice\PhpSpreadsheet\Cell\DataType” not found in […]/wp-content/plugins/woo-order-export-lite/classes/core/class-wc-order-export-engine.php(370) : eval()’d code:49

Viewing 1 replies (of 1 total)
  • Plugin Support aprokaev

    (@aprokaev)

    hello

    We use PHPExcel, so replace

    \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);

    with

    PHPExcel_Cell_DataType::TYPE_STRING

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.