Topic: Bug in Excel Reports
Hello, i experienced bug when generating excel reports.
My Server:
CENTOS 6.5
mysql 5.1
php 5.3
Nginx 1.6
Php-fpm
http://i57.tinypic.com/2vk00nr.jpg
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Report Bugs here → Bug in Excel Reports
Hello, i experienced bug when generating excel reports.
My Server:
CENTOS 6.5
mysql 5.1
php 5.3
Nginx 1.6
Php-fpm
http://i57.tinypic.com/2vk00nr.jpg
What language and fonts are you using and are they enabled in your CentOS?
Is it a browser mangling issue?
Try making the demo company print standard reports first before troubleshooting other issues.
Attached your Screenshot here.
It looks like you are using Arial font. See if your CentOS has that installed.
The attached file is what you should get for the Chart of Accounts for the demo data in en_US-demo.sql CoA.
update:
I am using windows in my development machine. The Centos in production. I have noticed in CentOS that when viewing the raw output using notepad++. The excel file has one blank row on top. Removing that would make the excel work.
Try to save the file from the URL in centos using wget and see if the blank line appears.
Also examine the file in a hex editor to see if it is a CRLF or just LF - (0D 0A or just 0A).
Then we can programattically remove it if it exists as the first character(s).
Attaching your screenshot for the forum.
LF "0A" exists as first character. Removing the first line removes the 0A. I think is not a browser issue
Please verify that the same result occurs when a different browser is used. Thanks for your patience in providing valuable feedback.
tried with chrome and firefox. still the same.
i would like to know the use of this function. since it has a Line Feed code "0x000A"
function _storeEof()
{
$record = 0x000A; // Record identifier
$length = 0x0000; // Number of bytes to follow
$header = pack("vv", $record, $length);
$this->_append($header);
}
The file reporting/includes/Workbook.php has the functions to write the Excel file and the said function is part of it that helps store the End of File characters (Eof) for the header in a hexadecimal byte packed manner. It is possible that some PHP versions on some platforms may be putting out blank headers and only these separators get to the top.
BIFF means BInary File Format. There are many types of BIFF records. Each has a 4 byte header. The first two bytes are an opcode that specifies the record type. The second two bytes specify record length. Header values are stored in byte-reversed form (less significant byte first). The rest of the record is the data itself
Other places where this is used so is at:
Line 195: http://voltampmedia.com/PHPExcel/html/_b_i_f_fwriter_8php_source.html
Line 195: http://phpcrossref.com/xref/moodle/lib/phpexcel/PHPExcel/Writer/Excel5/BIFFwriter.php.html#_storeeof
The Microsoft Excel Format is documented at:
https://www.openoffice.org/sc/excelfileformat.pdf
Excel97-2007 Binary File Format *.xls Specification.pdf
http://www.opennet.ru/docs/formats/xls.txt
I have just checked the generated file in the company folder and it was good. I tried removing the line
include_once($path_to_root . "/includes/session.inc");
from the prn_redirect.php file. The new line disappeared. Not sure if not including session.inc would cause some problems.
according to some stackoverflow answers, if you declare php closing tags ?> there might be newline inserts
The php closing tag issue generally comes up on PHP 5.4 onwards.
The include_once should have no effect and is needed to enforce authority to download only if logged in.
If the generated file is good, then the browser transfer may be the issue. Check the apache error logs for any clues.
FrontAccounting forum → Report Bugs here → Bug in Excel Reports
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.