develop faster.

PlatinumGrid has an extremely simple and flexible API. This allows developers to begin using PlatinumGrid very quickly, and allows them to access even advanced features with ease. This page demonstrates this easy-to-use API.

PlatinumGrid ships with over 30 examples covering virtually all features of the grid, that provide a simple and effective way of showing how to use the API. We've taken a few of these examples to convey some idea of the simplicity of using PlatinumGrid in any PHP application.

Note. For applications written using RadPHP, PlatinumGrid is a drag-and-drop component with complete integration into the RPCL. This page is intended for the developers who do not use RadPHP.

PlatinumGrid supports exporting grid results into PDF, XLS or CSV. It ships with all the necessary libraries to perform the export. Exporting is as simple as calling a particular method on the grid, as this example demonstrates.
require_once( '../vcl/platinumgrid/lib/Spreadsheet_Excel_Writer.php' );
'../vcl/platinumgrid/lib/tcpdf/tcpdf.php' );
'../' );

$dbConnection mysql_connect'localhost''root''' );

mysql_select_db'gridsamples'$dbConnection );

$dataSource = new MySQLDatasource$dbConnection );
$dataSource->DataSet->TableName 'employeestiny';

// Construct the grid.
$grid = new JTPlatinumGrid();
$grid->Datasource $dataSource;
$grid->Height '';
$grid->SiteTheme->Theme 'default';

$textCol = new JTPlatinumGridTextColumn$grid );
$textCol->Caption 'First Name';
$textCol->DataField 'FirstName';
$textCol->Name 'FirstNameCol';

$dateCol = new JTPlatinumGridDateTimeColumn$grid );
$dateCol->Caption 'Date';
$dateCol->DataField 'DateCol';
$dateCol->Display JTPlatinumGridDateTimeColumn::DateOnly;
$dateCol->Name 'DateCol';

$grid->Columns = array( $textCol$dateCol );


if( isset( 
$_POST'export' ] ) )
// Check which export button was pressed.
switch( $_POST'export' ] )
$grid->exportGridToPDFDownload'demoexport.pdf' );

$grid->exportGridToCSVDownload'demoexport.csv' );

$grid->exportGridToXLSDownload'demoexport.xls' );
  <title>Basic Export Demo</title>
  <h1>Basic Export Demo</h1>
  <form action="" method="post">
    <div id="<?php echo( $grid->Name ); ?>_outer">
<?php $grid->dumpContents(); ?>
      Export:<br />
      <input type="submit" name="export" value="PDF" />
      <input type="submit" name="export" value="CSV" />
      <input type="submit" name="export" value="XLS" />