/**
  * Class constructor
  *
  * @param string $fileName for storing the workbook. "-" for writing to stdout.
  * @access public
  */
 public function __construct($fileName)
 {
     // It needs to call its parent's constructor explicitly
     parent::__construct();
     $this->fileName = $fileName;
     $this->parser = new Spreadsheet_Excel_Writer_Parser($this->byteOrder, $this->BIFF_version);
     $this->flagFor1904 = 0;
     $this->activeSheet = 0;
     $this->firstSheet = 0;
     $this->selectedWorkBook = 0;
     $this->xf_index = 16;
     // 15 style XF's and 1 cell XF.
     $this->fileIsClosed = 0;
     $this->biffSize = 0;
     $this->sheetName = 'Sheet';
     $this->temporaryFormat = new Spreadsheet_Excel_Writer_Format($this->BIFF_version);
     $this->workSheet = array();
     $this->sheetNames = array();
     $this->formats = array();
     $this->palette = array();
     $this->codePage = 0x4e4;
     // FIXME: should change for BIFF8
     $this->countryCode = -1;
     $this->stringSizeInfo = 3;
     // Add the default format for hyperlinks
     $this->urlFormat = $this->addFormat(array('color' => 'blue', 'underline' => 1));
     $this->totalStringLength = 0;
     $this->uniqueString = 0;
     $this->tableOfStrings = array();
     $this->setPaletteXl97();
 }
Exemplo n.º 2
0
 /**
  * Class constructor
  *
  * @param string filename for storing the workbook. "-" for writing to stdout.
  * @access public
  */
 public function __construct($filename)
 {
     // It needs to call its parent's constructor explicitly
     parent::__construct();
     $this->_filename = $filename;
     $this->_parser = new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);
     $this->_1904 = 0;
     $this->_activesheet = 0;
     $this->_firstsheet = 0;
     $this->_selected = 0;
     $this->_xf_index = 16;
     // 15 style XF's and 1 cell XF.
     $this->_fileclosed = 0;
     $this->_biffsize = 0;
     $this->_sheetname = 'Sheet';
     $this->_tmp_format = new Spreadsheet_Excel_Writer_Format($this->_BIFF_version);
     $this->_worksheets = array();
     $this->_sheetnames = array();
     $this->_formats = array();
     $this->_palette = array();
     $this->_codepage = 0x4e4;
     // FIXME: should change for BIFF8
     $this->_country_code = -1;
     $this->_string_sizeinfo = 3;
     // Add the default format for hyperlinks
     $this->_url_format = $this->addFormat(array('color' => 'blue', 'underline' => 1));
     $this->_str_total = 0;
     $this->_str_unique = 0;
     $this->_str_table = array();
     $this->_timestamp = time();
     $this->_setPaletteXl97();
 }
    /**
    * Constructor
    *
    * @param string  $name         The name of the new worksheet
    * @param integer $index        The index of the new worksheet
    * @param mixed   &$activesheet The current activesheet of the workbook we belong to
    * @param mixed   &$firstsheet  The first worksheet in the workbook we belong to
    * @param mixed   &$url_format  The default format for hyperlinks
    * @param mixed   &$parser      The formula parser created for the Workbook
    * @param string  $tmp_dir      The path to the directory for temporary files
    * @access private
    */
    function __construct($BIFF_version, $name,
                                                $index, &$activesheet,
                                                &$firstsheet, &$str_total,
                                                &$str_unique, &$str_table,
                                                &$url_format, &$parser,
                                                $tmp_dir)
    {
        // It needs to call its parent's constructor explicitly
        parent::__construct();
        $this->_BIFF_version   = $BIFF_version;
        $rowmax                = 65536; // 16384 in Excel 5
        $colmax                = 256;

        $this->name            = $name;
        $this->index           = $index;
        $this->activesheet     = &$activesheet;
        $this->firstsheet      = &$firstsheet;
        $this->_str_total      = &$str_total;
        $this->_str_unique     = &$str_unique;
        $this->_str_table      = &$str_table;
        $this->_url_format     = &$url_format;
        $this->_parser         = &$parser;

        //$this->ext_sheets      = array();
        $this->_filehandle     = '';
        $this->_using_tmpfile  = true;
        //$this->fileclosed      = 0;
        //$this->offset          = 0;
        $this->_xls_rowmax     = $rowmax;
        $this->_xls_colmax     = $colmax;
        $this->_xls_strmax     = 255;
        $this->_dim_rowmin     = $rowmax + 1;
        $this->_dim_rowmax     = 0;
        $this->_dim_colmin     = $colmax + 1;
        $this->_dim_colmax     = 0;
        $this->_colinfo        = array();
        $this->_selection      = array(0,0,0,0);
        $this->_panes          = array();
        $this->_active_pane    = 3;
        $this->_frozen         = 0;
        $this->selected        = 0;

        $this->_paper_size      = 0x0;
        $this->_orientation     = 0x1;
        $this->_header          = '';
        $this->_footer          = '';
        $this->_hcenter         = 0;
        $this->_vcenter         = 0;
        $this->_margin_head     = 0.50;
        $this->_margin_foot     = 0.50;
        $this->_margin_left     = 0.75;
        $this->_margin_right    = 0.75;
        $this->_margin_top      = 1.00;
        $this->_margin_bottom   = 1.00;

        $this->title_rowmin     = null;
        $this->title_rowmax     = null;
        $this->title_colmin     = null;
        $this->title_colmax     = null;
        $this->print_rowmin     = null;
        $this->print_rowmax     = null;
        $this->print_colmin     = null;
        $this->print_colmax     = null;

        $this->_print_gridlines  = 1;
        $this->_screen_gridlines = 1;
        $this->_print_headers    = 0;

        $this->_fit_page        = 0;
        $this->_fit_width       = 0;
        $this->_fit_height      = 0;

        $this->_hbreaks         = array();
        $this->_vbreaks         = array();

        $this->_protect         = 0;
        $this->_password        = null;

        $this->col_sizes        = array();
        $this->_row_sizes        = array();

        $this->_zoom            = 100;
        $this->_print_scale     = 100;

        $this->_outline_row_level = 0;
        $this->_outline_style     = 0;
        $this->_outline_below     = 1;
        $this->_outline_right     = 1;
        $this->_outline_on        = 1;

        $this->_merged_ranges     = array();

        $this->_input_encoding    = '';

        $this->_dv                = array();

        $this->_tmp_dir = $tmp_dir;

        $this->_initialize();
    }