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
  • Merge requests
  • !331

Allow column types to be overridden when writing sheet rows

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Andrzej Brynczka requested to merge github/fork/PropertyBrands/master into master Sep 07, 2022
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 2

This PR adds a new writeSheetRowWithColTypes method used to set or override column types while writing row data.

The original column types defined by writeSheetHeader are retained so that the process can revert back to them after writing the current row's data, allowing the header versions to serve as default definitions for the columns.

Additionally, users can limit the column type override to target specific columns rather than the entire row:

$writer->writeSheetHeader($sheet, ['col1' => 'string', 'col2' => 'integer']);
$writer->writeSheetRow($sheet, ['val1', 1]);

$writer-> writeSheetRowWithColTypes($sheet, ['val2', 'n/a'], [], ['string', 'string']); // override the entire row
$writer-> writeSheetRowWithColTypes($sheet, ['val3', '?'], [], [1 => 'string']); // override col 2 only
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/PropertyBrands/master