diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index c26c5b570b4..fc4fd2010d4 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -622,7 +622,7 @@ if ($step == 4 && $datatoexport)
// test d'affichage du tableau excel
/*
print '
| ';
- viewExcelFileContent($conf->export->dir_temp.'/1/export_commande_1.xls');
+ viewExcelFileContent($conf->export->dir_temp.'/1/export_commande_1.xls',5);
print ' |
';
*/
}
diff --git a/htdocs/includes/modules/export/export_excel.modules.php b/htdocs/includes/modules/export/export_excel.modules.php
index 2814a9f1f75..49e4961c0bc 100644
--- a/htdocs/includes/modules/export/export_excel.modules.php
+++ b/htdocs/includes/modules/export/export_excel.modules.php
@@ -146,26 +146,25 @@ class ExportExcel extends ModeleExports
function write_record($array_alias,$array_selected_sorted,$objp)
{
- global $langs;
+ global $langs;
- $this->col=0;
- foreach($array_selected_sorted as $code => $value)
+ $this->col=0;
+ foreach($array_selected_sorted as $code => $value)
+ {
+ $alias=$array_alias[$code];
+ $newvalue=$objp->$alias;
+ // Nettoyage newvalue
+ $newvalue=clean_html($newvalue);
+ // Traduction newvalue
+ if (eregi('^\((.*)\)$',$newvalue,$reg))
{
- $alias=$array_alias[$code];
- $newvalue=$objp->$alias;
- // Nettoyage newvalue
- $newvalue=clean_html($newvalue);
- // Traduction newvalue
- if (eregi('^\((.*)\)$',$newvalue,$reg))
- {
- $newvalue=$langs->transnoentities($reg[1]);
- }
-
- $this->worksheet->write($this->row, $this->col, $newvalue);
- $this->col++;
- }
- $this->row++;
- return 0;
+ $newvalue=$langs->transnoentities($reg[1]);
+ }
+ $this->worksheet->write($this->row, $this->col, $newvalue);
+ $this->col++;
+ }
+ $this->row++;
+ return 0;
}
diff --git a/htdocs/includes/php_writeexcel/class.writeexcel_worksheet.inc.php b/htdocs/includes/php_writeexcel/class.writeexcel_worksheet.inc.php
index f323608eae4..18cf9f09be0 100644
--- a/htdocs/includes/php_writeexcel/class.writeexcel_worksheet.inc.php
+++ b/htdocs/includes/php_writeexcel/class.writeexcel_worksheet.inc.php
@@ -1904,9 +1904,9 @@ function set_row() {
$record = 0x0200; // Record identifier
$length = 0x000A; // Number of bytes to follow
$row_min = $this->_dim_rowmin; // First row
- $row_max = $this->_dim_rowmax; // Last row plus 1
+ $row_max = $this->_dim_rowmax + 1; // Last row plus 1
$col_min = $this->_dim_colmin; // First column
- $col_max = $this->_dim_colmax; // Last column plus 1
+ $col_max = $this->_dim_colmax + 1; // Last column plus 1
$reserved = 0x0000; // Reserved by Excel
$header = pack("vv", $record, $length);
diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php
index 00b1e18c8ab..b651db96017 100644
--- a/htdocs/lib/functions.inc.php
+++ b/htdocs/lib/functions.inc.php
@@ -3355,7 +3355,7 @@ function viewExcelFileContent($file_to_include='',$max_rows=0,$max_cols=0)
$data->setOutputEncoding('CPa25a');
$data->read($file_to_include);
error_reporting(E_ALL ^ E_NOTICE);
-
+
echo "