/// <summary> /// Generates the content of the output Excel file. /// </summary> public string Generate(ExcelExporter.Output output) { switch (output) { case ExcelExporter.Output.Csv: return(GenerateCsv()); case ExcelExporter.Output.ExcelXml: return(GenerateExcelXml(this)); default: throw new NotSupportedException(); } }
/// <summary> /// Gets the file extension for a specified output format. /// </summary> public string GetFileExtension(ExcelExporter.Output output) { switch (output) { case ExcelExporter.Output.ExcelXml: return(".xls"); case ExcelExporter.Output.Csv: return(".csv"); default: throw new NotSupportedException(); } }
public Document ToDocument(ExcelExporter.Output type) { return(new Document(Generate(type).ToBytesWithSignature(Encoding.UTF8), DocumentName + GetFileExtension(type))); }
public Blob ToDocument(ExcelExporter.Output type) => new Blob(Generate(type).GetUtf8WithSignatureBytes(), DocumentName + GetFileExtension(type));