I’m trying to add a method to export a report by id
.
has many reports.
created an API method
API return JSON
= OK.
but
calling any sql always returns the same result:
"current_field": null,
"field_count": null,
"lengths": null,
"num_rows": null,
"type": null
why?
and
$module->db->database = {
"affected_rows": null,
"client_info": null,
"client_version": null,
"connect_errno": null,
"connect_error": null,
"errno": null,
"error": null,
"error_list": null,
"field_count": null,
"host_info": null,
"info": null,
"insert_id": null,
"server_info": null,
"server_version": null,
"stat": null,
"sqlstate": null,
"protocol_version": null,
"thread_id": null,
"warning_count": null
}
only null
try code:
\service\v4\SugarWebServiceImplv4.php
public function get_report()
{
include_once "modules/AOR_Reports/AOR_Report.php";
$report = new AOR_Report();
$report->report_module = 'AOR_Reports';
$report->id = $_REQUEST['report_id'];
$report->build_api_report();
}
\modules\AOR_Reports\AOR_Report.php
public function build_api_report()
{
$this->build_report_csv(); // default CSV export method
}
result: return only csv headers