<< Back to embedding reports

Embed SQL Results Output

You can run report output without having to create a report. Just set the reportico project that relates to the database you want to run against (using the initial_project parameter) and use the initial_sql parameter to provide the SQL query. Note you cannot use the SELECT * notation in Reportico, you have to specify report columns.
Notice how column aliases in the SQL are used to set column titles.


Note the use of the set_attribute function to set the report title. You can hide the report title instead using the call :-

$engine->output_template_parameters["show_hide_report_output_title"] = "hide";

Customer List

  Output: HTML PDF CSV
Style Table Form
Show
 
Unable To Continue:
Notice: A non well formed numeric value encountered
Main Report Query - Error: Query Failed

SELECT CustomerID AS Id, companyname as company, contactname as contact_name FROM customers

Status 0 -