break; case 'pdf': if ($this->pdfFilePointer !== false) { if ($this->pdf !== null) { $this->pdf->Close(); } $this->flushPDF(); fclose($this->pdfFilePointer); $this->pdfFilePointer = false; } if ($this->pdfUseTempFileForOutput) { $this->output = file_get_contents($this->pdfFilename); @unlink($this->pdfFilename); } break; } } public static function encodeCSV($text) { $escapedText = '"' . str_replace(ReportOutputter::$CSV_ENCODE_FROM, ReportOutputter::$CSV_ENCODE_TO, $text) . '"'; return $escapedText; } public static function encodeTSV($text) { $escapedText = str_replace(ReportOutputter::$TSV_ENCODE_FROM, ReportOutputter::$TSV_ENCODE_TO, $text); return $escapedText; } } ReportOutputter::$OUTPUT_FORMATS = array((object) array('format' => 'html', 'mimeType' => 'application/octet-stream', 'extension' => '.html', 'description' => 'HTML'), (object) array('format' => 'csv', 'mimeType' => 'text/csv', 'extension' => '.csv', 'description' => 'Comma-Separated Values'), (object) array('format' => 'tsv', 'mimeType' => 'text/tab-separated-values', 'extension' => '.tsv', 'description' => 'Tab-Separated Values'), (object) array('format' => 'xls', 'mimeType' => 'application/vnd.ms-excel', 'extension' => '.xls', 'description' => 'XLS Spreadsheet'), (object) array('format' => 'pdf', 'mimeType' => 'application/pdf', 'extension' => '.pdf', 'description' => 'Portable Document Format (PDF)')); ReportOutputter::$PDF_PAGE_FORMATS = array((object) array('format' => 'a3', 'description' => 'A3'), (object) array('format' => 'a4', 'description' => 'A4'), (object) array('format' => 'a5', 'description' => 'A5'), (object) array('format' => 'letter', 'description' => 'Letter'), (object) array('format' => 'legal', 'description' => 'Legal')); ReportOutputter::$PDF_PAGE_ORIENTATIONS = array((object) array('orientation' => 'P', 'description' => 'Portrait'), (object) array('orientation' => 'L', 'description' => 'Landscape'));
$this->flushPDF(); fclose($this->pdfFilePointer); $this->pdfFilePointer = false; } if ($this->pdfUseTempFileForOutput) { $this->output = file_get_contents($this->pdfFilename); @unlink($this->pdfFilename); } break; } } public static function encodeCSV($text) { $escapedText = '"' . str_replace(ReportOutputter::$CSV_ENCODE_FROM, ReportOutputter::$CSV_ENCODE_TO, $text) . '"'; return $escapedText; } public static function encodeTSV($text) { $escapedText = str_replace(ReportOutputter::$TSV_ENCODE_FROM, ReportOutputter::$TSV_ENCODE_TO, $text); return $escapedText; } } ReportOutputter::$OUTPUT_FORMATS = array((object) array('format' => 'html', 'mimeType' => 'application/octet-stream', 'extension' => '.html', 'description' => 'HTML'), (object) array('format' => 'csv', 'mimeType' => 'text/csv', 'extension' => '.csv', 'description' => 'Comma-Separated Values'), (object) array('format' => 'tsv', 'mimeType' => 'text/tab-separated-values', 'extension' => '.tsv', 'description' => 'Tab-Separated Values')); if (class_exists('Spreadsheet_Excel_Writer', false)) { ReportOutputter::$OUTPUT_FORMATS[] = (object) array('format' => 'xls', 'mimeType' => 'application/vnd.ms-excel', 'extension' => '.xls', 'description' => 'XLS Spreadsheet'); } if (class_exists('File_PDF', false)) { ReportOutputter::$OUTPUT_FORMATS[] = (object) array('format' => 'pdf', 'mimeType' => 'application/pdf', 'extension' => '.pdf', 'description' => 'Portable Document Format (PDF)'); } ReportOutputter::$PDF_PAGE_FORMATS = array((object) array('format' => 'a3', 'description' => 'A3'), (object) array('format' => 'a4', 'description' => 'A4'), (object) array('format' => 'a5', 'description' => 'A5'), (object) array('format' => 'letter', 'description' => 'Letter'), (object) array('format' => 'legal', 'description' => 'Legal')); ReportOutputter::$PDF_PAGE_ORIENTATIONS = array((object) array('orientation' => 'P', 'description' => 'Portrait'), (object) array('orientation' => 'L', 'description' => 'Landscape'));