Exemple #1
0
        /// <summary>
        /// Method that generates an Excel (xml/xlsx) file with combined grid statistics.
        /// </summary>
        /// <param name="addSettings"></param>
        /// <param name="addProvenance"></param>
        /// <returns>An Excel file of the type xml or xlsx.</returns>
        public FileResult CombinedGridStatisticsAsExcel(bool addSettings = true, bool addProvenance = true)
        {
            SetServerDone();

            if (SessionHandler.MySettings.Presentation.FileFormat.ExcelFileSettings.IsSettingsDefault())
            {
                CombinedGridStatisticsExcelXlsx file = FileExportManager.GetCombinedGridStatisticsAsExcelXlsx(GetCurrentUser(), addSettings, addProvenance);
                MemoryStream returnStream            = file.ToStream();

                return(File(returnStream, XlsxExcelFileMimeType, CreateXlsxExcelFileName("CombinedGridStatistics")));
            }
            else
            {
                CombinedGridStatisticsExcelXml file = FileExportManager.GetCombinedGridStatisticsAsExcelXml(GetCurrentUser(), addSettings, addProvenance);
                MemoryStream returnStream           = file.ToStream();
                return(File(returnStream, XmlExcelFileMimeType, CreateXmlExcelFileName("CombinedGridStatistics")));
            }
        }
Exemple #2
0
        /// <summary>
        /// Creates an xlsx excel file with combined grid 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 xlsx excel file.</returns>
        public static CombinedGridStatisticsExcelXlsx GetCombinedGridStatisticsAsExcelXlsx(IUserContext currentUser, bool addSettings, bool addProvenance)
        {
            CombinedGridStatisticsExcelXlsx file = new CombinedGridStatisticsExcelXlsx(currentUser, addSettings, addProvenance);

            return(file);
        }