Ejemplo n.º 1
0
        /// <summary>
        /// Method that generates an Excel (xml/xlsx) file with summary statistics per polygon.
        /// </summary>
        /// <param name="addSettings"></param>
        /// <param name="addProvenance"></param>
        /// <returns>An Excel file of the type xml or xlsx.</returns>
        public FileResult SummaryStatisticsPerPolygonAsExcel(bool addSettings = true, bool addProvenance = true)
        {
            SetServerDone();

            if (SessionHandler.MySettings.Presentation.FileFormat.ExcelFileSettings.IsSettingsDefault())
            {
                SummaryStatisticsPerPolygonExcelXlsx file = FileExportManager.GetSummaryStatisticsPerPolygonAsExcelXlsx(GetCurrentUser(), addSettings, addProvenance);
                MemoryStream returnStream = file.ToStream();
                return(File(returnStream, XlsxExcelFileMimeType, CreateXlsxExcelFileName("SummaryStatisticsPerPolygon")));
            }
            else
            {
                SummaryStatisticsPerPolygonExcelXml file = FileExportManager.GetSummaryStatisticsPerPolygonAsExcelXml(GetCurrentUser(), addSettings, addProvenance);
                MemoryStream returnStream = file.ToStream();

                return(File(returnStream, XmlExcelFileMimeType, CreateXmlExcelFileName("SummaryStatisticsPerPolygon")));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an xml excel file with summary statistics per polygon.
        /// </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 SummaryStatisticsPerPolygonExcelXml GetSummaryStatisticsPerPolygonAsExcelXml(IUserContext currentUser, bool addSettings, bool addProvenance)
        {
            SummaryStatisticsPerPolygonExcelXml file = new SummaryStatisticsPerPolygonExcelXml(currentUser, addSettings, addProvenance);

            return(file);
        }