PHP code example of mochrira / selvi-report

1. Go to this page and download the library: Download mochrira/selvi-report library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mochrira / selvi-report example snippets


 
    = new \Selvi\Pdf();
    $pdf->pageStart([
        'margins' => ['bottom' => .5, 'top' => .5]
    ]);

        $pdf->pageHeader(function ($pdf) {
            $pdf->rowStart();
            $pdf->column('Page Header');
            $pdf->rowEnd();
        });

        $pdf->band(function ($pdf) {
            $pdf->rowStart();
            $pdf->column('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.', ['width' => '50%', 'multiline' => false, 'border' => 1]);
            $pdf->column('Halo', ['width' => '50%']);
            $pdf->rowEnd();
        });

        $pdf->pageFooter(function ($pdf) {
            $pdf->rowStart();
            $pdf->column('Page '.$pdf->PageNo());
            $pdf->rowEnd();
        });

    $pdf->pageEnd();

    $pdf->render();

...

$pdf->masterStart();
    $pdf->masterHeader(function ($pdf) {
        $pdf->rowStart();
        $pdf->column('Master Header 1');
        $pdf->rowEnd();
    });
        for($i=1; $i<=125; $i++) {
            $pdf->masterBand(function ($pdf) use ($i) {
                $pdf->rowStart();
                $pdf->column('Master Band 1 - '.$i);
                $pdf->rowEnd();
            });
        }
    $pdf->band(function ($pdf) {
        $pdf->rowStart();
        $pdf->column('Master Footer uses generic band'.$i);
        $pdf->rowEnd();
        $pdf->Ln();
    });
$pdf->masterEnd();

...