Exemple #1
0
 /// <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")));
     }
 }
Exemple #2
0
        /// <summary>
        /// Creates an xlsx 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 xlsx excel file.</returns>
        public static ObservedTaxonCountListAsExcelXlsx GetObservedTaxonCountListAsExcelXlsx(IUserContext currentUser, bool addSettings, bool addProvenance)
        {
            ObservedTaxonCountListAsExcelXlsx file = new ObservedTaxonCountListAsExcelXlsx(currentUser, addSettings, addProvenance);

            return(file);
        }