-
Notifications
You must be signed in to change notification settings - Fork 16
Create a comparison report
The code implements two reporting classes: XBRL_Report and XBRL_Report_Compare. Both are descendants of XBRL_Report_Base. They are simple reports. Not simple in the sense of naive. The reports are complex in the sense that they show examples of how to handle multiple and nested hyper-cubes and tuples within presentation role hierarchies. They are simple in the sense that they produce simple reports with periods as columns.
A comparison report begins by instantiating an instance of XBRL_Report_Compare.
$report = new XBRL_Report_Compare();
Next add the instance documents you want to include in the report. The function will check that the instance documents use the same taxonomy.
$report->addInstanceDocument( 'instance document 1.xml' );
$report->addInstanceDocument( 'instance document 2.xml' );
The main step is to prepare a presentation. When the presentation role hierarchies were create during the compile step hyper-cubes were added to nodes representing primary items. During the preparePresentation step these are expanded to relevant dimensions and members. Dimensions can have default members but can have limited value so there is an option to prevent them being added.
$report->excludeDefaultDimensionMembers();
$report->preparePresentation();
Finally generate the HTML rendering and save to disk.
$html = $report->toHtml();
$date = date( "Y-m-d" );
file_put_contents( "report_{$date}.html", $html );
Copyright © 2021 and later years Lyquidity Solutions Limited
- About us
- Purpose
- XBRL support
- Road Map
- Why PHP?
- Contributing
- License
- Reference links
- Case Study
- Digital Financial Reporting
- Digital Financial Reporting examples
Overview
Class and function reference
Compiled taxonomy structure
Common arrays
Compiling
Compiling
Processing linkbases
Additional taxonomy processing
Extension taxonomies
Compiled taxonomy folder
How do I...?
Navigate a node tree
Find a node in a tree
Find elements in a taxonomy
Load an instance document
Find elements in an instance
Create a simple report
Create a comparison report
Example custom report
Work with dimensions
Sign and Verify
Validate
Change the logging
Capture validation information