/// <summary> /// Method that generates an Excel (xml/xlsx) file with observed taxon list and taxon count. /// </summary> /// <param name="addSettings"></param> /// <param name="addProvenance"></param> /// <returns>An Excel file of the type xml or xlsx.</returns> public FileResult SpeciesObservationCountPerTaxonAsExcel(bool addSettings = true, bool addProvenance = true) { SetServerDone(); if (SessionHandler.MySettings.Presentation.FileFormat.ExcelFileSettings.IsSettingsDefault()) { ObservedTaxonCountListAsExcelXlsx file = FileExportManager.GetObservedTaxonCountListAsExcelXlsx(GetCurrentUser(), addSettings, addProvenance); MemoryStream returnStream = file.ToStream(); return(File(returnStream, XlsxExcelFileMimeType, CreateXlsxExcelFileName("SpeciesObservationCountPerTaxon"))); } else { ObservedTaxonCountListAsExcelXml file = FileExportManager.GetObservedTaxonCountListAsExcelXml(GetCurrentUser(), addSettings, addProvenance); MemoryStream returnStream = file.ToStream(); return(File(returnStream, XmlExcelFileMimeType, CreateXmlExcelFileName("SpeciesObservationCountPerTaxon"))); } }
/// <summary> /// Creates an xml excel file with the list of observed taxon. /// </summary> /// <param name="currentUser">Current user context</param> /// <param name="addSettings">True if settings sheet should be included</param> /// <param name="addProvenance">True if provenance sheet should be included.</param> /// <returns>The xml excel file.</returns> public static ObservedTaxonCountListAsExcelXml GetObservedTaxonCountListAsExcelXml(IUserContext currentUser, bool addSettings, bool addProvenance) { ObservedTaxonCountListAsExcelXml file = new ObservedTaxonCountListAsExcelXml(currentUser, addSettings, addProvenance); return(file); }