How export custom report data into PDF format
Content
Exist a rightnow function (in php code) that allows to export the custom data report result into PDF format file or that allows to create a PDF file with the incident data fields?
Thanks.
Version
Oracle Service Cloud May 2017 SP4Code Snippet
$report_id=100053;
$status_filter= new RNCPHP\AnalyticsReportSearchFilter;
$status_filter->Name = 'Project Reference Number';
$status_filter->Values = array( $incident->ReferenceNumber );
$filters = new RNCPHP\AnalyticsReportSearchFilterArray;
$filters[] = $status_filter;
$ar= RNCPHP\AnalyticsReport::fetch( $report_id);
$arr= $ar->run( 0, $filters );
for ( $i =$arr->count(); $i-- )
{
$row = $arr->next();
$obj_array[] = $row;
}
var_dump($obj_array);
$fileName="ProjectReport.pdf";
$fattach = new RNCPHP\FileAttachmentIncident();
$fattach->ContentType = "application/pdf";
//How Can I create a PDF file with the $obj_array result?
//$file_content = $obj_array;
$fp = $fattach->makeFile();
fwrite($fp,$file_content);
fclose($fp);
$fattach->FileName = $fileName;
$fattach->Name =$fileName;
$incident->FileAttachments[] = $fattach;
$incident->save();
Tagged:
0