You are here

function ViewsDataExportExporterDOC::bof in Views data export 7.4

Write the start of the export file.

Parameters

$file_handle: A PHP file handle to the export file.

Overrides ViewsDataExportExporter::bof

File

exporters/views_data_export_exporter_doc.inc, line 48

Class

ViewsDataExportExporterDOC
This exporter creates a DOC file readable by Microsoft Word. The content is an HTML table, as used by the old XLS export mechanism.

Code

function bof(&$file_handle) {
  $output = '<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  </head>
  <body>
    <table>
      <thead><tr>';
  foreach ($this->options['field_labels'] as $field) {
    $output .= '<th>' . $field . '</th>';
  }
  $output .= '</tr></thead>
      <tbody>';
  fwrite($file_handle, $output . "\n");
}