Exemple #1
0
 /// <summary>
 /// Method that generates an Excel (xml/xlsx) file with summary statistics.
 /// </summary>
 /// <param name="addSettings"></param>
 /// <param name="addProvenance"></param>
 /// <returns>An Excel file of the type xml or xlsx.</returns>
 public FileResult SummaryStatisticsAsExcel(bool addSettings = true, bool addProvenance = true)
 {
     SetServerDone();
     if (SessionHandler.MySettings.Presentation.FileFormat.ExcelFileSettings.IsSettingsDefault())
     {
         SummaryStatisticsExcelXlsx file = FileExportManager.GetSummaryStatisticsAsExcelXlsx(GetCurrentUser(), addSettings, addProvenance);
         MemoryStream returnStream       = file.ToStream();
         return(File(returnStream, XlsxExcelFileMimeType, CreateXlsxExcelFileName("SummaryStatistics")));
     }
     else
     {
         SummaryStatisticsExcelXml file = FileExportManager.GetSummaryStatisticsAsExcelXml(GetCurrentUser(), addSettings, addProvenance);
         MemoryStream returnStream      = file.ToStream();
         return(File(returnStream, XmlExcelFileMimeType, CreateXmlExcelFileName("SummaryStatistics")));
     }
 }
Exemple #2
0
        /// <summary>
        /// Creates an xml excel file with summary statistics.
        /// </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 SummaryStatisticsExcelXml GetSummaryStatisticsAsExcelXml(IUserContext currentUser, bool addSettings, bool addProvenance)
        {
            SummaryStatisticsExcelXml file = new SummaryStatisticsExcelXml(currentUser, addSettings, addProvenance);

            return(file);
        }