phpGrid currently supports export in native Excel format, CSV, PDF, and HTML format. When the export feature is enabled, phpGrid displays an export icon in the footer. Users can export data to Excel in php or any one of the supported file formats Also see enable_export().
If you want to enable users to export data from the PHP grids, you should enable this feature. By default, users can export to Microsoft Office Excel, PDF, HTML, or CSV any list of data that appears in a grid. Export to Excel produces native Microsoft Excel .xls file format.
Native Excel .xls format is now supported in version 6.7. Previously Excel export is in OpenOffice XML .xml format.X
Users can export data to Excel in php or any one of the supported file formats by clicking the Export button that appears in the footer. Users can only export data appears in the datagrid. All hidden columns made with set_col_hidden()
are not included in the export. It is not recommended to enable export feature when the datagrid contains data such as social security numbers or passwords.
When users click Export button, the phpGrid will generate the export file by using data from the database table in Ajax. Data that does not appear on the screen is not exported. If search filter is used, only the filtered results are exported.
When the datagrid contains fields that reference to others database tables through lookups, the text will be used in the export rather than the id fields. Please check out the “select” control type in set_col_edittype function.
PDF and CSV formats are now supported (Available to Professional and Enterprise Licenses) !
$dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");
// change column titles
$dg->set_col_title("orderNumber", "Order No.");
$dg->set_col_title("orderDate", "Order Date");
$dg->set_col_title("shippedDate", "Shipped Date");
$dg->set_col_title("customerNumber", "Customer No.");
// hide a column
// change default caption
// EXCEL export
$dg2 = new C_DataGrid("select * from customers", "customerNumber", "Customers");
// PDF export
See Live Demo!
* In Basic edition, export feature is limited to non-lookup tables only Parameter(s): $type: Export type…
If you are using phpGrid in a language rather English, you may want the datagrid to…