[ Index ] |
|
Code source de Dolibarr 2.0.1 |
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 # Set the column width for columns 2 and 3 13 $worksheet->set_column(1, 2, 20); 14 15 # Set the row height for row 2 16 $worksheet->set_row(2, 30); 17 18 # Create a border format 19 $border1 =& $workbook->addformat(); 20 $border1->set_color('white'); 21 $border1->set_bold(); 22 $border1->set_size(15); 23 $border1->set_pattern(0x1); 24 $border1->set_fg_color('green'); 25 $border1->set_border_color('yellow'); 26 $border1->set_top(6); 27 $border1->set_bottom(6); 28 $border1->set_left(6); 29 $border1->set_align('center'); 30 $border1->set_align('vcenter'); 31 $border1->set_merge(); # This is the key feature 32 33 # Create another border format. Note you could use copy() here. 34 $border2 =& $workbook->addformat(); 35 $border2->set_color('white'); 36 $border2->set_bold(); 37 $border2->set_size(15); 38 $border2->set_pattern(0x1); 39 $border2->set_fg_color('green'); 40 $border2->set_border_color('yellow'); 41 $border2->set_top(6); 42 $border2->set_bottom(6); 43 $border2->set_right(6); 44 $border2->set_align('center'); 45 $border2->set_align('vcenter'); 46 $border2->set_merge(); # This is the key feature 47 48 # Only one cell should contain text, the others should be blank. 49 $worksheet->write (2, 1, "Merged Cells", $border1); 50 $worksheet->write_blank(2, 2, $border2); 51 52 $workbook->close(); 53 54 header("Content-Type: application/x-msexcel"); 55 $fh=fopen($fname, "rb"); 56 fpassthru($fh); 57 unlink($fname); 58 59 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |