I have some fields that contains CRLF and when I export to CSV those fields are empty or contains only the data before the first CRLF.
If I try to export to Excel it says that the file is corrupted.
There seems to be some known issue with tcpdf library that we are using.
You can use the PDF based on html renderer and it does not have such issue, fallback is it's not very good for big datasets.
CSV export is also working as exptected.
PDF: http://www.phpgrid.org/demo/demos/export/export-pdf-html.phps
Screen: http://prntscr.com/al8u70
CSV: http://www.phpgrid.org/demo/demos/export/export-csv.phps
Screen: http://prntscr.com/al8y8b
To fix in default pdf lib, you need to edit lib/inc/tcpdf/class.TCPDF.EasyTable.php
replace;
$this->MultiCell($cellWidth, $cellHeight,$cellText, 1, $textAlign, $this->_FillCell, 0, '', '', true, 0, false, true, $cellHeight);
with:
$this->MultiCell($cellWidth, $cellHeight,$cellText, 1, $textAlign, $this->_FillCell, 0, '', '', true, 0, true, true, $cellHeight);
note: true, 0, false -> true, 0, true
Thanks for the info for PDF export.
My problem is with Excel and csv export. When I populate my data in a temp data I add n between data for each line in the field that is setup as Text type. I have also tried to put rn but still doesn't export after first line.
Do you need my sample database data to try it? Also please note that I do not use yet version 2 of phpgrid.
Please email me sample data at [email protected]
Also email me screenshots of the issue you are facing.
A got it to work for csv but I am still getting an error with Excel: It says that the file is in a different format than specified by the file extension and after clicking Yes to continue,it says that the file cannot be opened. I will email you the table sample data.
Emailed you a phpexcel working demo.
For others:
Download PHPExcel lib from codeplex, and extract in lib/inc/excel. (final folders should be like lib/inc/excel/PHPExcel.php and lib/inc/excel/PHPExcel directory)
https://gist.github.com/gridphp/71f6e504682a2283362f5f347ecdae4c
Hello , I gained with you the license " Developer " when performing a query, use the "Order By" instruction and gives me an error when exported to an Excel file .
"Couldn't execute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY 1 asc' at line 1 – SELECT Opportunity, Stage, Status, B.name, B.Lastname, Customer_ID, Company_name, Origin, Destination, DATEDIFF('2016-03-30 12:14:58',Date) AS Days_to_Close, Date, Updated, SUM(Amount) AS Amount, SUM(Profit) AS Profit FROM pipeline A LEFT JOIN gwm.user B ON A.Sales_Responsible=B.Username WHERE 1=1 GROUP BY A.Opportunity HAVING ORDER BY 1 asc"