[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/includes/php_writeexcel/ -> example-simple.php (source)

   1  <?php
   2  
   3  set_time_limit(10);
   4  
   5  require_once  "class.writeexcel_workbook.inc.php";
   6  require_once  "class.writeexcel_worksheet.inc.php";
   7  
   8  $fname = tempnam("/tmp", "merge2.xls");
   9  $workbook = &new writeexcel_workbook($fname);
  10  $worksheet = &$workbook->addworksheet();
  11  
  12  # The general syntax is write($row, $column, $token). Note that row and
  13  # column are zero indexed
  14  #
  15  
  16  # Write some text
  17  $worksheet->write(0, 0,  "Hi Excel!");
  18  
  19  # Write some numbers
  20  $worksheet->write(2, 0,  3);          # Writes 3
  21  $worksheet->write(3, 0,  3.00000);    # Writes 3
  22  $worksheet->write(4, 0,  3.00001);    # Writes 3.00001
  23  $worksheet->write(5, 0,  3.14159);    # TeX revision no.?
  24  
  25  # Formulas are not yet supported
  26  //$worksheet->write(7, 0,  '=A3 + A6');
  27  //$worksheet->write(8, 0,  '=IF(A5>3,"Yes", "No")');
  28  
  29  # Write a hyperlink
  30  $worksheet->write(7, 0, 'http://www.php.net/');
  31  
  32  $workbook->close();
  33  
  34  header("Content-Type: application/x-msexcel");
  35  $fh=fopen($fname, "rb");
  36  fpassthru($fh);
  37  unlink($fname);
  38  
  39  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics