当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_ReferenceHelper::updateFormulaReferences方法代码示例

本文整理汇总了PHP中PHPExcel_ReferenceHelper::updateFormulaReferences方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_ReferenceHelper::updateFormulaReferences方法的具体用法?PHP PHPExcel_ReferenceHelper::updateFormulaReferences怎么用?PHP PHPExcel_ReferenceHelper::updateFormulaReferences使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_ReferenceHelper的用法示例。


在下文中一共展示了PHPExcel_ReferenceHelper::updateFormulaReferences方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _castToFormula

	private function _castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType) {
		// echo '<font color="darkgreen">Formula</font><br />';
		// echo '$c->f is '.$c->f.'<br />';
		$cellDataType = 'f';
		$value = "={$c->f}";
		$calculatedValue = self::$castBaseType ( $c );
		
		// Shared formula?
		if (isset ( $c->f ['t'] ) && strtolower ( ( string ) $c->f ['t'] ) == 'shared') {
			// echo '<font color="darkgreen">SHARED FORMULA</font><br />';
			$instance = ( string ) $c->f ['si'];
			
			// echo 'Instance ID = '.$instance.'<br />';
			//
			// echo 'Shared Formula Array:<pre>';
			// print_r($sharedFormulas);
			// echo '</pre>';
			if (! isset ( $sharedFormulas [( string ) $c->f ['si']] )) {
				// echo '<font color="darkgreen">SETTING NEW SHARED
				// FORMULA</font><br />';
				// echo 'Master is '.$r.'<br />';
				// echo 'Formula is '.$value.'<br />';
				$sharedFormulas [$instance] = array (
						'master' => $r,
						'formula' => $value 
				);
				// echo 'New Shared Formula Array:<pre>';
				// print_r($sharedFormulas);
				// echo '</pre>';
			} else {
				// echo '<font color="darkgreen">GETTING SHARED
				// FORMULA</font><br />';
				// echo 'Master is '.$sharedFormulas[$instance]['master'].'<br
				// />';
				// echo 'Formula is '.$sharedFormulas[$instance]['formula'].'<br
				// />';
				$master = PHPExcel_Cell::coordinateFromString ( $sharedFormulas [$instance] ['master'] );
				$current = PHPExcel_Cell::coordinateFromString ( $r );
				
				$difference = array (
						0,
						0 
				);
				$difference [0] = PHPExcel_Cell::columnIndexFromString ( $current [0] ) - PHPExcel_Cell::columnIndexFromString ( $master [0] );
				$difference [1] = $current [1] - $master [1];
				
				$value = $this->_referenceHelper->updateFormulaReferences ( $sharedFormulas [$instance] ['formula'], 'A1', $difference [0], $difference [1] );
				// echo 'Adjusted Formula is '.$value.'<br />';
			}
		}
	}
开发者ID:nanpeixoto,项目名称:cide,代码行数:51,代码来源:Excel2007.php

示例2: _castToFormula

 private function _castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType)
 {
     $cellDataType = 'f';
     $value = "={$c->f}";
     $calculatedValue = self::$castBaseType($c);
     // Shared formula ?
     if (isset($c->f['t']) && strtolower((string) $c->f['t']) == 'shared') {
         $instance = (string) $c->f['si'];
         if (!isset($sharedFormulas[(string) $c->f['si']])) {
             $sharedFormulas[$instance] = array('master' => $r, 'formula' => $value);
         } else {
             $master = PHPExcel_Cell::coordinateFromString($sharedFormulas[$instance]['master']);
             $current = PHPExcel_Cell::coordinateFromString($r);
             $difference = array(0, 0);
             $difference[0] = PHPExcel_Cell::columnIndexFromString($current[0]) - PHPExcel_Cell::columnIndexFromString($master[0]);
             $difference[1] = $current[1] - $master[1];
             $value = $this->_referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]);
         }
     }
 }
开发者ID:skyosev,项目名称:OpenCart-Overclocked,代码行数:20,代码来源:Excel2007.php

示例3: castToFormula

 private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType)
 {
     //        echo 'Formula', PHP_EOL;
     //        echo '$c->f is ', $c->f, PHP_EOL;
     $cellDataType = 'f';
     $value = "={$c->f}";
     $calculatedValue = self::$castBaseType($c);
     // Shared formula?
     if (isset($c->f['t']) && strtolower((string) $c->f['t']) == 'shared') {
         //            echo 'SHARED FORMULA', PHP_EOL;
         $instance = (string) $c->f['si'];
         //            echo 'Instance ID = ', $instance, PHP_EOL;
         //
         //            echo 'Shared Formula Array:', PHP_EOL;
         //            print_r($sharedFormulas);
         if (!isset($sharedFormulas[(string) $c->f['si']])) {
             //                echo 'SETTING NEW SHARED FORMULA', PHP_EOL;
             //                echo 'Master is ', $r, PHP_EOL;
             //                echo 'Formula is ', $value, PHP_EOL;
             $sharedFormulas[$instance] = array('master' => $r, 'formula' => $value);
             //                echo 'New Shared Formula Array:', PHP_EOL;
             //                print_r($sharedFormulas);
         } else {
             //                echo 'GETTING SHARED FORMULA', PHP_EOL;
             //                echo 'Master is ', $sharedFormulas[$instance]['master'], PHP_EOL;
             //                echo 'Formula is ', $sharedFormulas[$instance]['formula'], PHP_EOL;
             $master = PHPExcel_Cell::coordinateFromString($sharedFormulas[$instance]['master']);
             $current = PHPExcel_Cell::coordinateFromString($r);
             $difference = array(0, 0);
             $difference[0] = PHPExcel_Cell::columnIndexFromString($current[0]) - PHPExcel_Cell::columnIndexFromString($master[0]);
             $difference[1] = $current[1] - $master[1];
             $value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]);
             //                echo 'Adjusted Formula is ', $value, PHP_EOL;
         }
     }
 }
开发者ID:makranelhoucine,项目名称:pfa_ensaobox,代码行数:36,代码来源:Excel2007.php


注:本文中的PHPExcel_ReferenceHelper::updateFormulaReferences方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。