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

Subscribe to our news:
Partners
Testimonials
Dionys Henzen: "Congratulations! Your MySQL PHP Generator is a great tool, that can save a lot of time and money to a developer! I'll evaluate for sure your software products when I need them. Great job".
Steven Langfield: "I wanted to drop you a mail to say how freaking AMAZING your software is. It will be the best £100 I have ever spent. I have still to read all your documentation to take full advantage but what you have created is truly amazing".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

Print & Export enability methods

The following methods allow to enable/disable various print and export abilities for a page.

 

Signature

Description

setPrintListAvailable($value)

Allows to print all records from a grid.

setExportListAvailable(array $exportFormats)

Allows to export all records from a grid to the given formats.

setAllowPrintSelectedRecords($value)

Allows to print the selected records from a grid.

setExportSelectedRecordsAvailable(array $exportFormats)

Allows to export the selected records from a grid to the given formats.

setPrintListRecordAvailable($value)

Allows to print a single record from a grid.

setExportListRecordAvailable(array $exportFormats)

Allows to export a single record from a grid to the given formats.

setPrintOneRecordAvailable($value)

Allows to print a record from a view form.

setExportOneRecordAvailable(array $exportFormats)

Allows to export a record from a view form to the given formats.

 

The $exportFormats array can include the following values: 'pdf', 'excel', 'word', 'xml', 'csv'.

 

The code in the examples below should be placed into the OnPreparePage event handler:

 

Example 1:

To allow to export the selected records in 'pdf' and 'word' formats only, use the following code:

 

$this->setExportSelectedRecordsAvailable(array('pdf', 'word'));

 

 

Example 2:

To allow to execute any print operations only for users with admin permissions, use the following code:

 

$isPageAdmin = $this->IsLoggedInAsAdmin();

$this->setPrintListAvailable($isPageAdmin);

$this->setAllowPrintSelectedRecords($isPageAdmin);

$this->setPrintListRecordAvailable($isPageAdmin);

$this->setPrintOneRecordAvailable($isPageAdmin);

 

 

Example 3:

To disable any export operations for ordinary users, use the following code:

 

$isOrdinaryUser = !$this->IsLoggedInAsAdmin();

if ($isOrdinaryUser) {

  $this->setExportListAvailable(array());

  $this->setExportSelectedRecordsAvailable(array());

  $this->setExportListRecordAvailable(array());

  $this->setExportOneRecordAvailable(array());

}

 



Prev Return to chapter overview Next