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

Subscribe to our news:
Partners
Testimonials
David Lantz: "Thank you, this is by far the simplest, and most friendly utility for building db record system I have ever used. I wish I could get my systems guys at the office to purchase this for our company would be so very helpful and speed up a lot of work. I for one have used it for everything from a simple inventory record of my house, to a members record for my church just little pet projects and a test bed to test my own db builds and theories before having to hand code at the office..... it is a lot of fun to work with".
Grey: "We're a two-person company, it's just me an my wife. I'm the technical guru, and she handles the business operations. I have to know a lot about MySQL, but that's much too technical for her. I have frequently had to setup CGI scripts (I code in Perl) so she can manage some of our tables (suppliers, manufacturers, etc).

I discovered PHP Generator a couple of days ago, tried the free version,and within a few hours I had purchased the Pro version (as well as SQL Maestro for MySQL).

Today I am completing the conversion of the last of my custom table managers to PHP Generator. This is eliminating several thousand lines of code that I don't have to support any more!

Thanks for this fantastic product".

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.

margin-left

Distance in mm from the left side of page to the left side of text.

margin-right

Distance in mm from the right side of page to the right side of text.

margin-top

Distance in mm from top of page to start of text (ignoring any headers).

margin-bottom

Distance in mm from bottom of page to bottom of text (ignoring any footers).

margin-header

Distance in mm from top of page to start of header.

margin-footer

Distance in mm from bottom of page to bottom of footer.

header

In any page header, '{PAGENO}' or '{DATE j-m-Y}' can be used - which will be replaced by the page number or current date. j-m-Y can be replaced by any of the valid formats used in the php

date() function.

 

The page number is the calculated number, taking regard of any resetting of numbering during the document.

html-header

Standard HTML code to define the header of pdf file. It can only be defined outside HTML block tags (except <body>).

footer

In any page footer, '{PAGENO}' or '{DATE j-m-Y}' can be used - which will be replaced by the page number or current date. j-m-Y can be replaced by any of the valid formats used in the php

date() function.

 

The page number is the calculated number, taking regard of any resetting of numbering during the document.

html-footer

Standard HTML code to specify the footer of pdf file. It can only be defined outside HTML block tags (except <body>).

 

Export to Excel

file-format

The format of the output file. Possible values are "xlsx" and "xls".

Default value is "xlsx".

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 "phpexcel". If you customize templates for export to Excel then you should use the "template" engine.

 

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;

 

Example

This example shows how to customize header, footer and margins of pdf file.

 

if ($exportType == 'pdf') {

 

  $options['header'] = '{DATE Y-m-d}';

 

  $options['footer'] = '{PAGENO}';

 

  $options['margin-top'] = 12;  

 

}



Prev Return to chapter overview Next