def create_report(format, data_set, options={})
      if options[:headers] === true
        options[:headers] = data_set.shift
      end

      validate_export_format(format)
      validate_export_data_lengths(data_set, options[:headers])

      format_class = MakeExportable.exportable_formats[format.to_sym]
      formater = format_class.new(data_set, options[:headers])
      return formater.generate, formater.mime_type
    end
def create_report(format, data_set, options={})
      if options[:headers] === true
        options[:headers] = data_set.shift
      end

      validate_export_format(format)
      validate_export_data_lengths(data_set, options[:headers])

      format_class = MakeExportable.exportable_formats[format.to_sym]
      formater = format_class.new(data_set, options[:headers])
      return formater.generate, formater.mime_type
    end
<tt>create_report</tt> creates a report from a set of data. It takes three arguments:
 a format, the data set to use for the report, and an optional hash of options.
 The only meaningful option is :headers which sets the strings to be used as column
 headers for the data set. The value of :headers can be:
 * true - headers are the first row in the data set
 * false - headers are not in the data set and should not be added
 * array of strings to use for the column headers

 The length of the headers must match the length of each row in the data set.