Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Charles Phillips: "Just want to take a second to really thank you for all the great support you give – I think that’s by far the best feature you offer".
Ananda Theerthan J: "I have been looking for PHP generator for years and now I am happy that I found one. Yes, its the PHP generator for MySQL. I completely rate 10/10 for this product for making life easier. It has lot of features and capabilities especially the CRUD, lookups and data partitioning. I love this product and recommend to others".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnGetCustomExportOptions

This event fires on exporting data from a database to a file. It allows you to customize some advanced export settings.

 

Signature:

function OnGetCustomExportOptions ($Page page, $exportType, $rowData, &$options)

 

Parameters:

$page

An instance of the Page class.

$exportType

The type of the result file. Possible values are "csv", "xls", "doc", "pdf", "xml".

$rowData

An associative array of values that corresponds to the currently processed row (for exporting a single row). NULL if a record list is exported.

$options

An associative array of options passed to the export engine (see below).

 

The list of supported options is as follows:

 

All export types

filename

The name of the output file.

 

Export to PDF

orientation

Page orientation. Possible values are "P" (portrait orientation) or "L" (landscape orientation). Default value is "P".

size

Size of the page. Possible values are A0 - A10, B0 - B10, C0 - C10, 4A0, 2A0, RA0 - RA4, SRA0 - SRA4, Letter, Legal, Executive, Folio, Demy, Royal, A (type A paperback 111x178mm), B (type B paperback 128x198mm). Default value is A4.

 

Export to Excel

engine

The engine to be used on data export. Possible values are "template" (template-based export) and "phpexcel" (to create native .xls files). Default value is "template".

 

Example

This example shows how to customize the result file name according to row values. If a record list is exported, the file name is set to list.pdf (list.xml, list.xls, etc).

 

$options['filename'] = ($rowData ? $rowData['id'] : 'list') . '.' . $exportType;



Prev Return to chapter overview Next