Passing user login to a query
To report on data relating to the logged-in user, use the {FRAMEWORK_USER} in your SQL query, e.gSELECT column1, column2 FROM table WHERE userid = {FRAMEWORK_USER}To pass the user into Reportico you edit your runner script or the page that embeds Reportico to set a user as follows :-
$q->external_user = "USERID";
You can user a similar mechanism to passs other external values through the user_parameters array and then use them in the SQL. For example setting
$q->user_parameters["my_parameter"] = "my parameter value";allows to use them in the SQL with the USER_PARAM command :-
SELECT column1, column2 FROM table WHERE value = {USER_PARAM,my_parameter}
Use bootstrap styling or not
When embedding reportico into your application pages, the look and feel may depending on whether you are using bootstrap or not.The bootstrap_styles parameter controls whether Reportico should render its reports according to Bootstrap styling or not. By default, when runing in standalone mode, Reportico renders in bootstrap V3 and loads its own bootstrap. When embedding to fit in with your own application, you may want to override this default. You have the choice of turning off bootstrap completely for example:-
require_once('reportico.php'); $q->bootstrap_styles = false; $q->execute();or rendering for bootstrap 2 or 3 and using the bootstrap_preloaded get Reportico to use a preloaded bootstrap to avoid reloading it itself. To specify boot strap v2 or 3, set bootstrap_styles to "2" or "3". For example:-
require_once('reportico.php'); $q->bootstrap_styles = "3"; $q->bootstrap_preloaded = true; $q->execute();
Where are the reports stored?
Reportico stores all your project and report definitions your Yii2 runtime folder under reportico. Each project is a folder and each report is stored in xml files underneath.Change the look and feel of reportico
The overall styling of report output, criteria entry screen is customisable by editing the CSS scripts used by Reportico. You will find these under the Reportico assets folder folder under vendor/reportico/yii2-reportico/assets/css. If you are using Reportico in Bootstrap mode then look in reportico_boostrap.css otherwise look in reportico.css. In here you will be able to change styles for report rows, group headers, column headers, criteria selection boxes etc. You should use a web browser debugging tool to find the appropriate style classes to change.Since these files are published to the Yii2 public assets folder you should clear out the public foler containing these files so they can be republished.
The charting engine
Reportico's HTML charts are rendered using the NVD3 charting engine ( see http://nvd3.org/ ). Reportico also provides the alternative charting engine PCHART ( see http://pchart.sourceforge.net/ ). the NVD3 reports do not work well in Internet Explorer 7 or 8 .. if you wish to support charting for these browsers you set the default html chart to PCHART for these browsers by changing the run.php or whatever custom runner of web page you may be using and edit to line$q->charting_engine_html = "NVD3";to read
$q->charting_engine_html = "NVD3"; if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])) { $q->charting_engine_html = "PCHART"; }
Since these files are published to the Yii2 public assets folder you should clear out the public foler containing these files so they can be republished.