PHP code example of paoatoffice / reports-web

1. Go to this page and download the library: Download paoatoffice/reports-web 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/ */

    

paoatoffice / reports-web example snippets


use Pao\Reports\Web\PrintData;
use Pao\Reports\Web\ReportsWebEngine;

$definition = json_decode(file_get_contents('report.prepdj'), true);   // ブラウザのデザイナーで作った帳票定義

$printData = (new PrintData())
    ->setDefinition($definition)
    ->pageStart()
    ->setValue('Message', 'PHPから、あっという間に帳票出力')
    ->pageEnd();

$pdf = (new ReportsWebEngine('http://127.0.0.1:3107'))->renderPdf($printData);
file_put_contents('report.pdf', $pdf);
sh
git clone https://github.com/ReportsWeb/wasm-php.git
cd "wasm-php/01.あっという間に帳票出力"
docker compose up -d --build --wait --wait-timeout 180
# ブラウザで http://127.0.0.1:19200/ を開く
docker compose down --volumes   # 終わったら停止・削除