enable_export() *

* In Basic edition, export feature is limited to non-lookup tables only

  • Parameter(s):
    • $type: Export type can be EXCEL, EXCELXML, PDF, CSV, or HTML. The default is EXCEL, the native .xls format. EXCELXML is the OpenOffice .xml format.
    • $PDF_logo: Array. Requires commercial license 6.53+. It contains properties for
      • image logo file path,
      • width (optional)
      • height (optional)
      • static text (optional)
  • Description:
    • When export is enabled, the export icon appears in the grid footer. The datagrid can be exported in EXCEL, PDF, CSV or HTML format. The Excel is exported in native Excel XML format.  More formats will be supported in the future.
    • PDF export can take one array parameter for its logo. The second parameter can have logo file path, and optional width and height. When width and height are not defined, their values are based on 1/4 of actual logo image integer dimension.
  • Example:
1
$dg -> enable_export('EXCEL');

Export in PDF with a logo image (PDF logo requires commercial license 6.53+)

1
2
3
$count = $dg->db->num_rows($dg->db->db_query('SELECT * FROM orders'));
$pdf_prop = array(realpath('../logos/phpgrid-logo.jpg'), 50, 15, $count);
$dg -> enable_export('PDF', $pdf_prop);

 
pdf-export-prop