Пример #1
0
        /// <summary>
        /// Download PDF
        /// </summary>
        /// <param name="libraryName"></param>
        /// <param name="statistics"></param>
        /// <param name="startYear"></param>
        /// <param name="endYear"></param>
        /// <returns></returns>
        public ActionResult DownloadPdf(string libraryName, string statistics, string startYear, string endYear)
        {
            LibraryDataService libraryDataService = new LibraryDataService();
            object             result             = null;

            if (!string.IsNullOrEmpty(libraryName))
            {
                var              customTemplateDetails = customTemplateService.GetCustomTemplateById(Convert.ToInt32(statistics));
                var              libraryData           = libraryDataService.GetLibraryDataByNameAndYearRange(libraryName, Convert.ToInt32(startYear), Convert.ToInt32(endYear));
                string           mappingValue          = customTemplateDetails.MappingColumn;
                List <ChartData> chartData             = pdfService.BarChartData(libraryData, "MyltiYear", "bar", mappingValue);
                result = (from chart in chartData
                          select new { name = chart.Name, y = chart.Value }).ToList();
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }