Form Layout

The formLayout() method renders each column value on a separate line instead of as the default table format.



<?php
      \Reportico\Engine\Builder
::build()
          ...
          ->
formLayout()
          ...
          ->
execute();
?>
1


In the example below we show the report data as a form and we force a page break on each row. In order to get the page break working, we use the group() method to force each row to be treated as a group section (by grouping on a unique id column ). and then use the throwPageBefore() method to trigger the page break.

Run Demo


<?php

      
require_once(__DIR__ .'/../vendor/autoload.php');
      

      
\Reportico\Engine\Builder::build()
          ->
properties([ "bootstrap_preloaded" => true])
          ->
datasource()->database("mysql:host=localhost; dbname=DATABASE NAME")->user("USER")->password("PASSWORD")
          ->
title     ("Employee List")
          ->
description     ("Produces a list of our employees")
          ->
sql       ("
                SELECT EmployeeID employee_id, LastName last_name, FirstName first_name, date(BirthDate) birth_date, Country
                FROM northwind_employees
                ORDER BY Country, LastName
                "
)
          ->
group("employee_id")
            ->
throwPageBefore()
          ->
page()->formLayout()->paginate()
          ->
execute();
?>