• Resolved Sami S

    (@sami-sanpakkila)


    Hi

    When I export an xls file it opens in Excel as US letter size in portrait. Is it possible to add a snippet of code to change to A4 size landscape?

    Thanks!

    Sami

    • This topic was modified 2 years, 1 month ago by Sami S.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi

    please, open section “Misc Settings” and put this code

    add_action( 'woe_xls_PHPExcel_setup', function($objPHPExcel, $settings ){
    
    $objPHPExcel->getActiveSheet()
        ->getPageSetup()
        ->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
    $objPHPExcel->getActiveSheet()
        ->getPageSetup()
        ->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
    
    },10,2);
    Thread Starter Sami S

    (@sami-sanpakkila)

    Thanks, worked great!

    Plugin Author algol.plus

    (@algolplus)

    You’re welcome

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change exported xls page size to A4’ is closed to new replies.