Closed dukec2020 closed 11 years ago
Hi You may generate rows multiple times. First time you generate more {tags} for second time. Make template simple, one row for category, one for issues. You then load data for categories and generate all categories and for each category one row for issues to repeat. And then you load data for issues and generate rows for each category.
So:
$R=new PHPReport(...template...);
$R->load(...categories array...)
$R->generateReport()
...
$R->load(...issues array...)
$R->generateReport()
...
$R->renderXlsx(...)
I hope this helps.
I'll try it now. Thanks! On Aug 1, 2013 3:53 AM, "vernes" notifications@github.com wrote:
Hi You may generate rows multiple times. First time you generate more {tags} for second time. Make template simple, one row for category, one for issues. You then load data for categories and generate all categories and for each category one row for issues to repeat. And then you load data for issues and generate rows for each category.
So:
$R=new PHPReport(...template...);$R->load(...categories array...)$R->generateReport()...$R->load(...issues array...)$R->generateReport()...$R->renderXlsx(...)
I hope this helps.
— Reply to this email directly or view it on GitHubhttps://github.com/vernes/PHPReport/issues/5#issuecomment-21894826 .
Here is my code:
$r = new PHPReport(.. template...) $r->load ( array ( array ( 'id' => 'c', 'data' => array ( // 'name' => 'category 1' array('name' => 'category 1' ) , array('name' => 'category 2' ), array('name' => 'category 3' ) ), 'repeat' => true ) ) ); $r->generateReport (); $r->load ( array ( array ( 'id' => 'i', 'data' => array ( array ('name' => 'issue 1') , array ('name' => 'issue 2'), array ('name' => 'issue 3'), array ('name' => 'issue 4'), ), 'repeat' => true ) ) ); $r->generateReport (); $r->renderXlsx()...
With template But data render not like what I was expecting.
Resolved by do like this;
$r->load ( array ( array ( 'id' => 'c', 'data' => array ( array ( 'name' => 'cat 1', 'issue' => '{i1:name}' ), array ( 'name' => 'cat 2', 'issue' => '{i2:name}' ) ) , 'repeat' => true ) ) ); $r->generateReport (); $r->load ( array ( array ( 'id' => 'i1', 'data' => array ( array ( 'name' => 'iss 11' ), array ( 'name' => 'iss 12' ) ) , 'repeat' => true ) , array ( 'id' => 'i2', 'data' => array ( array ( 'name' => 'iss 21' ), array ( 'name' => 'iss 22' ) ) , 'repeat' => true ) ) ); $r->generateReport ();
The attach file describe data, there are multi category and each category has many issue. How to make template and setup data for this situation.