$worksheet->set_column(0, 3, 15); # Create a format for the column headings $header =& $workbook->addformat(); $header->set_bold(); $header->set_size(12); $header->set_color('blue'); # Write out the data $reportid = vtlib_purify($_REQUEST["record"]); $oReport = new Reports($reportid); $filtercolumn = $_REQUEST['stdDateFilterField']; $filter = $_REQUEST['stdDateFilter']; $startdate = getDBInsertDateValue($_REQUEST['startdate']); $enddate = getDBInsertDateValue($_REQUEST['enddate']); $oReportRun = new ReportRun($reportid); $filterlist = $oReportRun->RunTimeFilter($filtercolumn, $filter, $startdate, $enddate); $arr_val = $oReportRun->GenerateReport("PDF", $filterlist); $totalxls = $oReportRun->GenerateReport("TOTALXLS", $filterlist); if (isset($arr_val)) { foreach ($arr_val[0] as $key => $value) { $worksheet->write(0, $count, $key, $header); $count = $count + 1; } $rowcount = 1; foreach ($arr_val as $key => $array_value) { $dcount = 0; foreach ($array_value as $hdr => $value) { //$worksheet->write($key+1, $dcount, iconv("UTF-8", "ISO-8859-1", $value)); $value = decode_html($value); $worksheet->write($key + 1, $dcount, utf8_decode($value)); $dcount = $dcount + 1; }
} }//end of class */ $reportid = vtlib_purify($_REQUEST["record"]); $oReport = new Reports($reportid); //Code given by Csar Rodrguez for Rwport Filter $filtercolumn = $_REQUEST["stdDateFilterField"]; $filter = $_REQUEST["stdDateFilter"]; $oReportRun = new ReportRun($reportid); $startdate = getDBInsertDateValue($_REQUEST["startdate"]); //Convert the user date format to DB date format $enddate = getDBInsertDateValue($_REQUEST["enddate"]); //Convert the user date format to DB date format $filterlist = $oReportRun->RunTimeFilter($filtercolumn, $filter, $startdate, $enddate); $arr_val = $oReportRun->GenerateReport("PDF", $filterlist); if (isset($arr_val)) { foreach ($arr_val as $wkey => $warray_value) { foreach ($warray_value as $whd => $wvalue) { if (strlen($wvalue) < strlen($whd)) { $w_inner_array[] = strlen($whd); } else { $w_inner_array[] = strlen($wvalue); } } $warr_val[] = $w_inner_array; unset($w_inner_array); } foreach ($warr_val[0] as $fkey => $fvalue) { foreach ($warr_val as $wkey => $wvalue) { $f_inner_array[] = $warr_val[$wkey][$fkey];
* The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************/ require_once 'Smarty_setup.php'; require_once "modules/Reports/ReportRun.php"; require_once "modules/Reports/Reports.php"; global $app_strings; global $mod_strings; $oPrint_smarty = new vtigerCRM_Smarty(); $reportid = vtlib_purify($_REQUEST["record"]); $oReport = new Reports($reportid); $filtercolumn = $_REQUEST["stdDateFilterField"]; $filter = $_REQUEST["stdDateFilter"]; $oReportRun = new ReportRun($reportid); $startdate = DateTimeField::convertToDBFormat($_REQUEST["startdate"]); //Convert the user date format to DB date format $enddate = DateTimeField::convertToDBFormat($_REQUEST["enddate"]); //Convert the user date format to DB date format $filterlist = $oReportRun->RunTimeFilter($filtercolumn, $filter, $startdate, $enddate); $arr_values = $oReportRun->GenerateReport("PRINT", $filterlist); $total_report = $oReportRun->GenerateReport("PRINT_TOTAL", $filterlist); $oPrint_smarty->assign("COUNT", $arr_values[1]); $oPrint_smarty->assign("APP", $app_strings); $oPrint_smarty->assign("MOD", $mod_strings); $oPrint_smarty->assign("REPORT_NAME", $oReport->reportname); $oPrint_smarty->assign("PRINT_CONTENTS", $arr_values[0]); $oPrint_smarty->assign("TOTAL_HTML", $total_report); $oPrint_smarty->display("PrintReport.tpl");