You are here

public function PHPExcel_Worksheet_PageSetup::setScale in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/PageSetup.php \PHPExcel_Worksheet_PageSetup::setScale()

* Set Scale * * Print scaling. Valid values range from 10 to 400 * This setting is overridden when fitToWidth and/or fitToHeight are in use * *

Parameters

int? $pValue: * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth * @return PHPExcel_Worksheet_PageSetup * @throws PHPExcel_Exception

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/PageSetup.php, line 344

Class

PHPExcel_Worksheet_PageSetup
PHPExcel_Worksheet_PageSetup

Code

public function setScale($pValue = 100, $pUpdate = true) {

  // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
  // but it is apparently still able to handle any scale >= 0, where 0 results in 100
  if ($pValue >= 0 || is_null($pValue)) {
    $this->_scale = $pValue;
    if ($pUpdate) {
      $this->_fitToPage = false;
    }
  }
  else {
    throw new PHPExcel_Exception("Scale must not be negative");
  }
  return $this;
}