X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fexcel_report.inc;h=3786a91aaf9d92bcba4522a2096473deac9dc390;hb=366a3ecbcd7841413f980f9e1d65895b77af1b82;hp=ef387adaf1702f7d7f6728db7c33577281292a75;hpb=a9d55e1c13cbd6a6305b9322ec8621a06516f9f3;p=fa-stable.git diff --git a/reporting/includes/excel_report.inc b/reporting/includes/excel_report.inc index ef387ada..3786a91a 100644 --- a/reporting/includes/excel_report.inc +++ b/reporting/includes/excel_report.inc @@ -13,6 +13,7 @@ include_once($path_to_root . "/reporting/includes/Workbook.php"); include_once($path_to_root . "/admin/db/company_db.inc"); include_once($path_to_root . "/admin/db/fiscalyears_db.inc"); include_once($path_to_root . "/config.php"); +define('MAX_ROW_SHEET', 65530); // xls version class FrontReport extends Spreadsheet_Excel_Writer_Workbook { @@ -81,12 +82,12 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook $rtl = ($_SESSION['language']->dir == 'rtl'); $this->code = strtolower($_SESSION['language']->encoding); $this->filename = $filename.".xls"; - $this->unique_name = uniqid('').".xls"; + $this->unique_name = random_id().".xls"; $this->path = company_path(). '/pdf_files'; $this->Spreadsheet_Excel_Writer_Workbook($this->path."/".$this->unique_name); if ($this->code != "iso-8859-1") $this->setVersion(8); // set biff version to 8 (0x0006 internal) - $this->sheet =& $this->addWorksheet($this->worksheetNameGenerator($this->title)); + $this->sheet = $this->addWorksheet($this->worksheetNameGenerator($this->title)); if ($this->code != "iso-8859-1") $this->sheet->setInputEncoding($this->code); // set sheet encoding if ($rtl) @@ -641,6 +642,17 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook function NewLine($l=1, $np=0, $h=NULL) { $this->y += $l; + if ($this->y > MAX_ROW_SHEET) + { + $this->y = 0; + $this->sheet = $this->addWorksheet(); + if ($this->code != "iso-8859-1") + $this->sheet->setInputEncoding($this->code); // set sheet encoding + if ($_SESSION['language']->dir == 'rtl') + $this->sheet->setRTL(); + for ($i = 0; $i < $this->numcols; $i++) + $this->sheet->setColumn($i, $i, $this->px2units($this->cols[$i + 1] - $this->cols[$i])); + } } function NewPage()