Esempio n. 1
0
 /// <summary>
 /// Method that generates an Excel (xml/xlsx) file with provenances.
 /// </summary>
 /// <param name="addSettings"></param>
 /// <param name="addProvenance"></param>
 /// <returns>An Excel file of the type xml or xlsx.</returns>
 public FileResult SpeciesObservationProvenancesAsExcel(bool addSettings = true, bool addProvenance = true)
 {
     SetServerDone();
     if (SessionHandler.MySettings.Presentation.FileFormat.ExcelFileSettings.IsSettingsDefault())
     {
         SpeciesObservationProvenanceExcelXlsx file = FileExportManager.GetSpeciesObservationProvenanceAsExcelXlsx(GetCurrentUser(), addSettings, addProvenance);
         MemoryStream returnStream = file.ToStream();
         return(File(returnStream, XlsxExcelFileMimeType, CreateXlsxExcelFileName("SpeciesObservationProvenances")));
     }
     else
     {
         SpeciesObservationProvenanceExcelXml file = FileExportManager.GetSpeciesObservationProvenanceAsExcelXml(GetCurrentUser(), addSettings, addProvenance);
         MemoryStream returnStream = file.ToStream();
         return(File(returnStream, XmlExcelFileMimeType, CreateXmlExcelFileName("SpeciesObservationProvenances")));
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Creates an xml excel file with provenances.
        /// </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 SpeciesObservationProvenanceExcelXml GetSpeciesObservationProvenanceAsExcelXml(IUserContext currentUser, bool addSettings, bool addProvenance)
        {
            SpeciesObservationProvenanceExcelXml file = new SpeciesObservationProvenanceExcelXml(currentUser);

            return(file);
        }