Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P PHP_XLSXWriter
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 101
    • Issues 101
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 24
    • Merge requests 24
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • mk-j
  • PHP_XLSXWriter
  • Issues
  • #313
Closed
Open
Issue created Sep 13, 2021 by Prabakaran@prabakaran-p

How to hide specific columns?

Hi There,

I want to hide specific column in xlsx. I tried this way 'hidden'=>[1,1,1,1,0,0,0,0] in the writeSheetHeader and writeSheetRow. But it is hiding the entire row in the xlsx. `<?php set_include_path( get_include_path().PATH_SEPARATOR.".."); include_once("xlsxwriter.class.php");

$header = array( 'c1-text'=>'string',//text 'c2-text'=>'@',//text 'c3-integer'=>'integer', 'c4-integer'=>'0', 'c5-price'=>'price', 'c6-price'=>'#,##0.00',//custom 'c7-date'=>'date', 'c8-date'=>'YYYY-MM-DD', ); $rows = array( array('x101',102,103,104,105,106,'2018-01-07','2018-01-08'), array('x201',202,203,204,205,206,'2018-02-07','2018-02-08'), array('Total',302,303,304,305,306,'2018-03-07','2018-03-08') ); $writer = new XLSXWriter();

$writer->writeSheetHeader('Sheet1', $header, $style = array('widths'=>[40,50,20,10,40,50,20,10],'hidden'=>[1,1,1,1,0,0,0,0])); $style = array('widths'=>40, 'hidden'=>[1,1,1,1,0,0,0,0]); foreach($rows as $row){ $writer->writeSheetRow('Sheet1', $row, $style); } $writer->writeToFile(rand(1000,9999).'xlsx-simples.xlsx');

` Can anyone help me to find a solution?

Assignee
Assign to
Time tracking