init
This commit is contained in:
		@@ -0,0 +1,998 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using Kreta.Resources;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
using OfficeOpenXml.Style;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public abstract class BaseNyomtatvanyExcel : IDisposable
 | 
			
		||||
    {
 | 
			
		||||
        private const string ConstFontName = "Calibri";
 | 
			
		||||
 | 
			
		||||
        protected class CellStyle
 | 
			
		||||
        {
 | 
			
		||||
            public string Name { get; set; }
 | 
			
		||||
 | 
			
		||||
            /// integer (not really needed unless you need to round numbers, Excel with use default cell properties) --> "0"
 | 
			
		||||
            /// integer without displaying the number 0 in the cell -->  "#"
 | 
			
		||||
            /// number with 1 decimal place --> "0.0"
 | 
			
		||||
            /// number with 2 decimal places --> "0.00"
 | 
			
		||||
            /// number with 2 decimal places and thousand separator --> "#,##0.00"
 | 
			
		||||
            /// number with 2 decimal places and thousand separator and money symbol --> "€#,##0.00"
 | 
			
		||||
            /// percentage (1 = 100%, 0.01 = 1%) --> "0%"
 | 
			
		||||
            public string Numberformat { get; set; } = "0";
 | 
			
		||||
 | 
			
		||||
            public string BgColorHex { get; set; } = "transparent";
 | 
			
		||||
 | 
			
		||||
            public bool FontBold { get; set; }
 | 
			
		||||
 | 
			
		||||
            public int FontSize { get; set; } = 11;
 | 
			
		||||
 | 
			
		||||
            public string FontName { get; set; } = ConstFontName;
 | 
			
		||||
 | 
			
		||||
            public string FontColorHex { get; set; } = "automatic";
 | 
			
		||||
 | 
			
		||||
            public int TextRotation { get; set; }
 | 
			
		||||
 | 
			
		||||
            public bool WrapText { get; set; }
 | 
			
		||||
 | 
			
		||||
            public ExcelBorderStyle LeftBorder { get; set; } = ExcelBorderStyle.None;
 | 
			
		||||
 | 
			
		||||
            public ExcelBorderStyle RightBorder { get; set; } = ExcelBorderStyle.None;
 | 
			
		||||
 | 
			
		||||
            public ExcelBorderStyle TopBorder { get; set; } = ExcelBorderStyle.None;
 | 
			
		||||
 | 
			
		||||
            public ExcelBorderStyle BottomBorder { get; set; } = ExcelBorderStyle.None;
 | 
			
		||||
 | 
			
		||||
            public ExcelHorizontalAlignment HorizontalAlignment { get; set; } = ExcelHorizontalAlignment.Left;
 | 
			
		||||
 | 
			
		||||
            public ExcelVerticalAlignment VerticalAlignment { get; set; } = ExcelVerticalAlignment.Center;
 | 
			
		||||
 | 
			
		||||
            public CellStyle()
 | 
			
		||||
            { }
 | 
			
		||||
 | 
			
		||||
            public CellStyle(string Name)
 | 
			
		||||
            {
 | 
			
		||||
                this.Name = Name;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            public CellStyle(BaseNyomtatvanyExcel.CellStyle prevCellStyle)
 | 
			
		||||
            {
 | 
			
		||||
                Numberformat = prevCellStyle.Numberformat;
 | 
			
		||||
                BgColorHex = prevCellStyle.BgColorHex;
 | 
			
		||||
                FontBold = prevCellStyle.FontBold;
 | 
			
		||||
                FontSize = prevCellStyle.FontSize;
 | 
			
		||||
                FontName = prevCellStyle.FontName;
 | 
			
		||||
                FontColorHex = prevCellStyle.FontColorHex;
 | 
			
		||||
                TextRotation = prevCellStyle.TextRotation;
 | 
			
		||||
                WrapText = prevCellStyle.WrapText;
 | 
			
		||||
                LeftBorder = prevCellStyle.LeftBorder;
 | 
			
		||||
                RightBorder = prevCellStyle.RightBorder;
 | 
			
		||||
                TopBorder = prevCellStyle.TopBorder;
 | 
			
		||||
                BottomBorder = prevCellStyle.BottomBorder;
 | 
			
		||||
                HorizontalAlignment = prevCellStyle.HorizontalAlignment;
 | 
			
		||||
                VerticalAlignment = prevCellStyle.VerticalAlignment;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected string Author = "";
 | 
			
		||||
        protected ExcelPackage ExcelPackage;
 | 
			
		||||
        protected DataSet DataSet;
 | 
			
		||||
        protected string StoredProcedure = null;
 | 
			
		||||
        protected Dictionary<string, string> DbParameters = new Dictionary<string, string>();
 | 
			
		||||
 | 
			
		||||
        protected Dictionary<string, CellStyle> NamedCellStyles = new Dictionary<string, CellStyle>();
 | 
			
		||||
 | 
			
		||||
        protected CellStyle NormalStyle = null;
 | 
			
		||||
        protected CellStyle NormalStyleWrapText = null;
 | 
			
		||||
        protected CellStyle HeaderStyle = null;
 | 
			
		||||
        protected CellStyle HeaderStyle90 = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle IntegerStyle = null;
 | 
			
		||||
        protected CellStyle IntegerBoldStyle = null;
 | 
			
		||||
        protected CellStyle Numeric2Style = null;
 | 
			
		||||
        protected CellStyle Numeric2BoldStyle = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle NormalStyleBottomBordered = null;
 | 
			
		||||
        protected CellStyle NormalStyleCentered = null;
 | 
			
		||||
        protected CellStyle HeaderStyleBottomBordered = null;
 | 
			
		||||
        protected CellStyle HeaderStyle90BottomBordered = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle IntegerStyleBottomBordered = null;
 | 
			
		||||
        protected CellStyle IntegerBoldStyleBottomBordered = null;
 | 
			
		||||
        protected CellStyle Numeric2StyleBottomBordered = null;
 | 
			
		||||
        protected CellStyle Numeric2BoldStyleBottomBordered = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle HeaderStyleBottomBorderedBGGray = null;
 | 
			
		||||
        protected CellStyle HeaderStyle90BottomBorderedBGGray = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle DocnameStyle = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle DocheaderStyle1 = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle DocheaderStyle2 = null;
 | 
			
		||||
        protected CellStyle DocheaderStyleSideBordered = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle DocheaderStyleMergedUpperCell = null;
 | 
			
		||||
        protected CellStyle DocheaderStyleMergedLowerCell = null;
 | 
			
		||||
        protected CellStyle DocheaderStyleCenteredWithoutBorder = null;
 | 
			
		||||
 | 
			
		||||
        protected CellStyle Numeric2BoldBigerStyleBottomBordered = null;
 | 
			
		||||
        protected CellStyle PercentStyleBottomBordered = null;
 | 
			
		||||
        protected CellStyle PercentBoldStyleBottomBordered = null;
 | 
			
		||||
 | 
			
		||||
        protected bool isMultisheetExcel;
 | 
			
		||||
 | 
			
		||||
        private IConnectionType _connectionType;
 | 
			
		||||
 | 
			
		||||
        public DataSet GetSheetDataSet()
 | 
			
		||||
            => DataSet;
 | 
			
		||||
 | 
			
		||||
        protected BaseNyomtatvanyExcel(IConnectionType connectionType, bool isMultisheetExcel = false)
 | 
			
		||||
        {
 | 
			
		||||
            _connectionType = connectionType;
 | 
			
		||||
            this.isMultisheetExcel = isMultisheetExcel;
 | 
			
		||||
            NamedCellStyles.Add("NormalStyle", NormalStyle = new CellStyle("NormalStyle"));
 | 
			
		||||
            NamedCellStyles.Add("NormalStyleWrapText", NormalStyleWrapText = new CellStyle(NamedCellStyles["NormalStyle"]) { Name = "NormalStyleWrapText", WrapText = true });
 | 
			
		||||
            NamedCellStyles.Add("HeaderStyle", HeaderStyle = new CellStyle("HeaderStyle") { FontBold = true, WrapText = true });
 | 
			
		||||
            NamedCellStyles.Add("HeaderStyle90", HeaderStyle90 = new CellStyle(NamedCellStyles["HeaderStyle"]) { Name = "HeaderStyle90", TextRotation = 90, HorizontalAlignment = ExcelHorizontalAlignment.Center, VerticalAlignment = ExcelVerticalAlignment.Bottom });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("IntegerStyle", IntegerStyle = new CellStyle("IntegerStyle") { Numberformat = "0", HorizontalAlignment = ExcelHorizontalAlignment.Center });
 | 
			
		||||
            NamedCellStyles.Add("IntegerBoldStyle", IntegerBoldStyle = new CellStyle(NamedCellStyles["IntegerStyle"]) { Name = "IntegerBoldStyle", FontBold = true });
 | 
			
		||||
            NamedCellStyles.Add("Numeric2Style", Numeric2Style = new CellStyle("Numeric2Style") { Numberformat = "0.00", HorizontalAlignment = ExcelHorizontalAlignment.Center });
 | 
			
		||||
            NamedCellStyles.Add("Numeric2BoldStyle", Numeric2BoldStyle = new CellStyle(NamedCellStyles["Numeric2Style"]) { Name = "Numeric2BoldStyle", FontBold = true });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("NormalStyleBottomBordered", NormalStyleBottomBordered = new CellStyle("NormalStyleBottomBordered")
 | 
			
		||||
            {
 | 
			
		||||
                TopBorder = ExcelBorderStyle.None,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.None,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                RightBorder = ExcelBorderStyle.None,
 | 
			
		||||
            });
 | 
			
		||||
            NamedCellStyles.Add("NormalStyleCentered", NormalStyleCentered = new CellStyle("NormalStyleCentered")
 | 
			
		||||
            {
 | 
			
		||||
                HorizontalAlignment = ExcelHorizontalAlignment.Center,
 | 
			
		||||
                VerticalAlignment = ExcelVerticalAlignment.Center,
 | 
			
		||||
                WrapText = true
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("HeaderStyleBottomBordered", HeaderStyleBottomBordered = new CellStyle(NamedCellStyles["NormalStyleBottomBordered"]) { Name = "HeaderStyleBottomBordered", FontBold = true, WrapText = true });
 | 
			
		||||
            NamedCellStyles.Add("HeaderStyle90BottomBordered", HeaderStyle90BottomBordered = new CellStyle(NamedCellStyles["HeaderStyleBottomBordered"]) { Name = "HeaderStyle90BottomBordered", TextRotation = 90, HorizontalAlignment = ExcelHorizontalAlignment.Center, VerticalAlignment = ExcelVerticalAlignment.Bottom });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("IntegerStyleBottomBordered", IntegerStyleBottomBordered = new CellStyle(NamedCellStyles["NormalStyleBottomBordered"]) { Name = "IntegerStyleBottomBordered", Numberformat = "0", HorizontalAlignment = ExcelHorizontalAlignment.Center });
 | 
			
		||||
            NamedCellStyles.Add("IntegerBoldStyleBottomBordered", IntegerBoldStyleBottomBordered = new CellStyle(NamedCellStyles["IntegerStyleBottomBordered"]) { Name = "IntegerBoldStyleBottomBordered", FontBold = true });
 | 
			
		||||
            NamedCellStyles.Add("Numeric2StyleBottomBordered", Numeric2StyleBottomBordered = new CellStyle(NamedCellStyles["NormalStyleBottomBordered"]) { Name = "Numeric2StyleBottomBordered", Numberformat = "0.00", HorizontalAlignment = ExcelHorizontalAlignment.Center });
 | 
			
		||||
            NamedCellStyles.Add("Numeric2BoldStyleBottomBordered", Numeric2BoldStyleBottomBordered = new CellStyle(NamedCellStyles["Numeric2StyleBottomBordered"]) { Name = "Numeric2BoldStyleBottomBordered", FontBold = true });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("HeaderStyleBottomBorderedBGGray", HeaderStyleBottomBorderedBGGray = new CellStyle(NamedCellStyles["HeaderStyleBottomBordered"]) { Name = "HeaderStyleBottomBorderedBGGray", BgColorHex = "#AAAAAA" });
 | 
			
		||||
            NamedCellStyles.Add("HeaderStyle90BottomBorderedBGGray", HeaderStyle90BottomBorderedBGGray = new CellStyle(NamedCellStyles["HeaderStyle90BottomBordered"]) { Name = "HeaderStyle90BottomBorderedBGGray", BgColorHex = "#AAAAAA" });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("DocnameStyle", DocnameStyle = new CellStyle(NamedCellStyles["HeaderStyle"]) { Name = "DocnameStyle", FontSize = 16 });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("DocheaderStyle1", DocheaderStyle1 = new CellStyle(NamedCellStyles["HeaderStyle"])
 | 
			
		||||
            {
 | 
			
		||||
                Name = "DocheaderStyle1",
 | 
			
		||||
                FontColorHex = "#FFFFFF",
 | 
			
		||||
                BgColorHex = "#18A0C8",
 | 
			
		||||
                HorizontalAlignment = ExcelHorizontalAlignment.Left,
 | 
			
		||||
                VerticalAlignment = ExcelVerticalAlignment.Center
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("DocheaderStyleSideBordered", DocheaderStyleSideBordered = new CellStyle(NamedCellStyles["HeaderStyle"])
 | 
			
		||||
            {
 | 
			
		||||
                Name = "DocheaderStyleSideBordered",
 | 
			
		||||
                FontColorHex = "#FFFFFF",
 | 
			
		||||
                BgColorHex = "#18A0C8",
 | 
			
		||||
                HorizontalAlignment = ExcelHorizontalAlignment.Center,
 | 
			
		||||
                VerticalAlignment = ExcelVerticalAlignment.Center,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                RightBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.Thin
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("DocheaderStyleMergedUpperCell", DocheaderStyleMergedUpperCell = new CellStyle(NamedCellStyles["HeaderStyle"])
 | 
			
		||||
            {
 | 
			
		||||
                Name = "DocheaderStyleMergedUpperCell",
 | 
			
		||||
                FontColorHex = "#FFFFFF",
 | 
			
		||||
                BgColorHex = "#18A0C8",
 | 
			
		||||
                HorizontalAlignment = ExcelHorizontalAlignment.Left,
 | 
			
		||||
                VerticalAlignment = ExcelVerticalAlignment.Center,
 | 
			
		||||
                TopBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                RightBorder = ExcelBorderStyle.Thin
 | 
			
		||||
            });
 | 
			
		||||
            NamedCellStyles.Add("DocheaderStyleMergedLowerCell", DocheaderStyleMergedLowerCell = new CellStyle(NamedCellStyles["HeaderStyle"])
 | 
			
		||||
            {
 | 
			
		||||
                Name = "DocheaderStyleMergedLowerCell",
 | 
			
		||||
                HorizontalAlignment = ExcelHorizontalAlignment.Left,
 | 
			
		||||
                VerticalAlignment = ExcelVerticalAlignment.Center,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                RightBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.Thin
 | 
			
		||||
            });
 | 
			
		||||
            NamedCellStyles.Add("DocheaderStyleCenteredWithoutBorder", DocheaderStyleCenteredWithoutBorder = new CellStyle(NamedCellStyles["DocheaderStyle1"])
 | 
			
		||||
            {
 | 
			
		||||
                Name = "DocheaderStyleCenteredWithoutBorder",
 | 
			
		||||
                HorizontalAlignment = ExcelHorizontalAlignment.Center,
 | 
			
		||||
                VerticalAlignment = ExcelVerticalAlignment.Center,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.None,
 | 
			
		||||
                RightBorder = ExcelBorderStyle.None,
 | 
			
		||||
                TopBorder = ExcelBorderStyle.None,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.None
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("DocheaderStyle2", DocheaderStyle2 = new CellStyle(NamedCellStyles["DocheaderStyle1"]) { Name = "DocheaderStyle2", BgColorHex = "#5D5D5D" });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add("Numeric2BoldBigerStyleBottomBordered", Numeric2BoldBigerStyleBottomBordered = new CellStyle(NamedCellStyles["Numeric2BoldStyleBottomBordered"]) { Name = "Numeric2BoldBigerStyleBottomBordered", FontSize = 14 });
 | 
			
		||||
            NamedCellStyles.Add("PercentStyleBottomBordered", PercentStyleBottomBordered = new CellStyle(NamedCellStyles["NormalStyleBottomBordered"]) { Name = "PercentStyleBottomBordered", Numberformat = "0%", HorizontalAlignment = ExcelHorizontalAlignment.Center });
 | 
			
		||||
            NamedCellStyles.Add("PercentBoldStyleBottomBordered", PercentBoldStyleBottomBordered = new CellStyle(NamedCellStyles["PercentStyleBottomBordered"]) { Name = "PercentBoldStyleBottomBordered", FontBold = true });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected DataTable CreateDataTable(List<string[]> list)
 | 
			
		||||
        {
 | 
			
		||||
            var dataTable = new DataTable();
 | 
			
		||||
            var firstRow = true;
 | 
			
		||||
 | 
			
		||||
            foreach (var listRow in list)
 | 
			
		||||
            {
 | 
			
		||||
                if (firstRow)
 | 
			
		||||
                {
 | 
			
		||||
                    foreach (var hcol in listRow)
 | 
			
		||||
                        dataTable.Columns.Add(hcol);
 | 
			
		||||
                    firstRow = false;
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    int col = 0;
 | 
			
		||||
                    var dataRow = dataTable.NewRow();
 | 
			
		||||
                    foreach (DataColumn dataColumn in dataTable.Columns)
 | 
			
		||||
                        dataRow[dataColumn.ToString()] = listRow[col++];
 | 
			
		||||
 | 
			
		||||
                    dataTable.Rows.Add(dataRow);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return dataTable;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void SetExcelDataSet(DataSet ds = null)
 | 
			
		||||
        {
 | 
			
		||||
            if (ds == null)
 | 
			
		||||
            {
 | 
			
		||||
                if (DbParameters == null || StoredProcedure == null)
 | 
			
		||||
                {
 | 
			
		||||
                    throw new NullReferenceException("DB Parameterek nincsenek beallitva");
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                DataSet = new NyomtatvanyokHelper(_connectionType).GetNyomtatvanyStoredProcedureDataSet(StoredProcedure, DbParameters);
 | 
			
		||||
                if (DataSet == null)
 | 
			
		||||
                {
 | 
			
		||||
                    throw new NoNullAllowedException(StoredProcedure + " SP has no result!");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                DataSet = ds;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public abstract void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1);
 | 
			
		||||
 | 
			
		||||
        public MemoryStream ExcelNyomtatas()
 | 
			
		||||
        {
 | 
			
		||||
            return new MemoryStream(ExcelPackage.GetAsByteArray());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public MemoryStream ExcelNyomtatas(Dictionary<string, string> dbParameters)
 | 
			
		||||
        {
 | 
			
		||||
            if (!isMultisheetExcel)
 | 
			
		||||
            {
 | 
			
		||||
                if (dbParameters == null)
 | 
			
		||||
                {
 | 
			
		||||
                    throw new ApplicationException("Egy lapos excel munkafüzet nyomtatásához az adatbázis paraméterek kötelezőek.");
 | 
			
		||||
                }
 | 
			
		||||
                if (ExcelPackage.Workbook.Worksheets.Count > 0)
 | 
			
		||||
                {
 | 
			
		||||
                    GenerateNewExcelPackage();
 | 
			
		||||
                    SetWorkbookProperties();
 | 
			
		||||
                }
 | 
			
		||||
                CreateSheet(dbParameters);
 | 
			
		||||
            }
 | 
			
		||||
            return ExcelNyomtatas();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void SetWorkbookProperties()
 | 
			
		||||
        {
 | 
			
		||||
            ExcelPackage.Workbook.Properties.Author = "";
 | 
			
		||||
            ExcelPackage.Workbook.Properties.Title = "";
 | 
			
		||||
            ExcelPackage.Workbook.Properties.Company = "";
 | 
			
		||||
 | 
			
		||||
            foreach (KeyValuePair<string, CellStyle> style in NamedCellStyles)
 | 
			
		||||
                ChangeStyle(ExcelPackage.Workbook.Styles.CreateNamedStyle(style.Key), style.Value);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddNamedStyle(string styleName, CellStyle cellStyle)
 | 
			
		||||
            => ChangeStyle(ExcelPackage.Workbook.Styles.CreateNamedStyle(styleName), cellStyle);
 | 
			
		||||
 | 
			
		||||
        protected ExcelWorksheet CreateSheet(string sheetName, int position = 1, eOrientation orientation = eOrientation.Portrait, bool fitToPage = false, int fitToWidth = 1, int fitToHeight = 1, int fontSize = 11, string fontName = ConstFontName)
 | 
			
		||||
        {
 | 
			
		||||
            if (sheetName.Length > 31)
 | 
			
		||||
            {
 | 
			
		||||
                sheetName = sheetName.Substring(0, 31);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            ExcelWorksheet worksheet = ExcelPackage.Workbook.Worksheets[sheetName];
 | 
			
		||||
            if (worksheet == null)
 | 
			
		||||
            {
 | 
			
		||||
                worksheet = ExcelPackage.Workbook.Worksheets.Add(sheetName);
 | 
			
		||||
 | 
			
		||||
                worksheet.Cells.Style.Font.Size = fontSize;
 | 
			
		||||
                worksheet.Cells.Style.Font.Name = fontName;
 | 
			
		||||
                if (fitToPage)
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet.PrinterSettings.FitToPage = true;
 | 
			
		||||
                    worksheet.PrinterSettings.FitToWidth = fitToWidth;
 | 
			
		||||
                    worksheet.PrinterSettings.FitToHeight = fitToHeight;
 | 
			
		||||
                }
 | 
			
		||||
                worksheet.PrinterSettings.Orientation = orientation;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return worksheet;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public string ColumnLabel(int col)
 | 
			
		||||
        {
 | 
			
		||||
            var dividend = col;
 | 
			
		||||
            var columnLabel = string.Empty;
 | 
			
		||||
 | 
			
		||||
            while (dividend > 0)
 | 
			
		||||
            {
 | 
			
		||||
                var modulo = (dividend - 1) % 26;
 | 
			
		||||
                columnLabel = Convert.ToChar(65 + modulo) + columnLabel;
 | 
			
		||||
                dividend = (dividend - modulo) / 26;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return columnLabel;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddComment(ExcelWorksheet worksheet, int row, int col, string comment)
 | 
			
		||||
        {
 | 
			
		||||
            if (comment != null)
 | 
			
		||||
            {
 | 
			
		||||
                var commentCell = worksheet.Cells[row, col];
 | 
			
		||||
                AddComment(commentCell, comment);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddComment(ExcelRange cell, string comment)
 | 
			
		||||
        {
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(comment))
 | 
			
		||||
            {
 | 
			
		||||
                cell.AddComment(comment, Author);
 | 
			
		||||
                cell.Comment.AutoFit = true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private ExcelRange AddValueCell(ExcelWorksheet worksheet, int row, int col, object value)
 | 
			
		||||
        {
 | 
			
		||||
            if (row < 1 || col < 1)
 | 
			
		||||
                return null;
 | 
			
		||||
 | 
			
		||||
            var cell = worksheet.Cells[row, col];
 | 
			
		||||
            cell.Value = value;
 | 
			
		||||
            return cell;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private ExcelRange AddValueRange(ExcelWorksheet worksheet, int startRow, int startCol, int endRow, int endCol, object value)
 | 
			
		||||
        {
 | 
			
		||||
            if (startRow < 1 || startCol < 1 || endRow < 1 || endCol < 1)
 | 
			
		||||
                return null;
 | 
			
		||||
 | 
			
		||||
            var cell = worksheet.Cells[startRow, startCol, endRow, endCol];
 | 
			
		||||
            cell.Value = value;
 | 
			
		||||
            worksheet.Cells[startRow, startCol, endRow, endCol].Merge = true;
 | 
			
		||||
 | 
			
		||||
            return cell;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private ExcelRange AddFormulaCell(ExcelWorksheet worksheet, int row, int col, string value)
 | 
			
		||||
        {
 | 
			
		||||
            if (row < 1 || col < 1)
 | 
			
		||||
                return null;
 | 
			
		||||
 | 
			
		||||
            worksheet.Workbook.CalcMode = ExcelCalcMode.Automatic;
 | 
			
		||||
            var cell = worksheet.Cells[row, col];
 | 
			
		||||
            cell.Formula = value;
 | 
			
		||||
            return cell;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private ExcelRange AddFormulaRange(ExcelWorksheet worksheet, int startRow, int startCol, int endRow, int endCol, string value)
 | 
			
		||||
        {
 | 
			
		||||
            if (startRow < 1 || startCol < 1 || endRow < 1 || endCol < 1)
 | 
			
		||||
                return null;
 | 
			
		||||
 | 
			
		||||
            worksheet.Workbook.CalcMode = ExcelCalcMode.Automatic;
 | 
			
		||||
            var cell = worksheet.Cells[startRow, startCol, endRow, endCol];
 | 
			
		||||
            cell.Formula = value;
 | 
			
		||||
            worksheet.Cells[startRow, startCol, endRow, endCol].Merge = true;
 | 
			
		||||
 | 
			
		||||
            return cell;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddTanuloAdatokFejlec(ExcelWorksheet worksheet, int fejlecRow)
 | 
			
		||||
        {
 | 
			
		||||
            var tanuloNevCell = worksheet.Cells[fejlecRow, 1];
 | 
			
		||||
            tanuloNevCell.Value = TanuloResource.TanuloNeve;
 | 
			
		||||
            ChangeStyle(tanuloNevCell, HeaderStyleBottomBordered);
 | 
			
		||||
 | 
			
		||||
            var oktatasiAzonositoCell = worksheet.Cells[fejlecRow, 2];
 | 
			
		||||
            oktatasiAzonositoCell.Value = TanuloResource.OktatasiAzonosito;
 | 
			
		||||
            ChangeStyle(oktatasiAzonositoCell, HeaderStyleBottomBordered);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void ChangeStyle(ExcelRange cell, CellStyle cellStyle)
 | 
			
		||||
            => cell.StyleName = cellStyle.Name;
 | 
			
		||||
 | 
			
		||||
        private void ChangeStyle(OfficeOpenXml.Style.XmlAccess.ExcelNamedStyleXml excelNamedStyleXml, CellStyle cellStyle)
 | 
			
		||||
        {
 | 
			
		||||
            excelNamedStyleXml.Style.Numberformat.Format = cellStyle.Numberformat;
 | 
			
		||||
 | 
			
		||||
            excelNamedStyleXml.Style.Font.Bold = cellStyle.FontBold;
 | 
			
		||||
            excelNamedStyleXml.Style.TextRotation = cellStyle.TextRotation;
 | 
			
		||||
            excelNamedStyleXml.Style.HorizontalAlignment = cellStyle.HorizontalAlignment;
 | 
			
		||||
            excelNamedStyleXml.Style.VerticalAlignment = cellStyle.VerticalAlignment;
 | 
			
		||||
            excelNamedStyleXml.Style.WrapText = cellStyle.WrapText;
 | 
			
		||||
 | 
			
		||||
            var excelStyleBorder = excelNamedStyleXml.Style.Border;
 | 
			
		||||
            if (cellStyle.BottomBorder != ExcelBorderStyle.None)
 | 
			
		||||
                excelStyleBorder.Bottom.Style = cellStyle.BottomBorder;
 | 
			
		||||
            if (cellStyle.TopBorder != ExcelBorderStyle.None)
 | 
			
		||||
                excelStyleBorder.Top.Style = cellStyle.TopBorder;
 | 
			
		||||
            if (cellStyle.LeftBorder != ExcelBorderStyle.None)
 | 
			
		||||
                excelStyleBorder.Left.Style = cellStyle.LeftBorder;
 | 
			
		||||
            if (cellStyle.RightBorder != ExcelBorderStyle.None)
 | 
			
		||||
                excelStyleBorder.Right.Style = cellStyle.RightBorder;
 | 
			
		||||
            ChangeFontColor(excelNamedStyleXml.Style, cellStyle.FontColorHex);
 | 
			
		||||
            ChangeBgColor(excelNamedStyleXml.Style, cellStyle.BgColorHex);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void ChangeFontColor(ExcelStyle excelStyle, string fontColorHex = "automatic")
 | 
			
		||||
        {
 | 
			
		||||
            if (fontColorHex?.Equals("automatic", StringComparison.OrdinalIgnoreCase) == false)
 | 
			
		||||
                excelStyle.Font.Color.SetColor(System.Drawing.ColorTranslator.FromHtml(fontColorHex));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void ChangeBgColor(ExcelStyle excelStyle, string bgColorHex = "transparent")
 | 
			
		||||
        {
 | 
			
		||||
            if (bgColorHex?.Equals("transparent", StringComparison.OrdinalIgnoreCase) == false)
 | 
			
		||||
            {
 | 
			
		||||
                excelStyle.Fill.PatternType = ExcelFillStyle.Solid;
 | 
			
		||||
                excelStyle.Fill.BackgroundColor.SetColor(System.Drawing.ColorTranslator.FromHtml(bgColorHex));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private bool AddCellWithTypeCheck(ExcelWorksheet worksheet, int row, int col, object dtvalue, CellStyle cellStyle = null, string comment = null)
 | 
			
		||||
        {
 | 
			
		||||
            var aggregatedValues = true;
 | 
			
		||||
 | 
			
		||||
            switch (dtvalue)
 | 
			
		||||
            {
 | 
			
		||||
                case int _:
 | 
			
		||||
                case double _:
 | 
			
		||||
                    AddNumberCell(worksheet, row, col, dtvalue, cellStyle, comment);
 | 
			
		||||
                    break;
 | 
			
		||||
                case string _ when int.TryParse((string)dtvalue, out int intDtvalue):
 | 
			
		||||
                    AddNumberCell(worksheet, row, col, intDtvalue, cellStyle, comment);
 | 
			
		||||
                    break;
 | 
			
		||||
                case string _ when double.TryParse((string)dtvalue, out double doubleDtValue):
 | 
			
		||||
                    AddNumberCell(worksheet, row, col, doubleDtValue, cellStyle, comment);
 | 
			
		||||
                    break;
 | 
			
		||||
                default:
 | 
			
		||||
                    AddLabelCell(worksheet, row, col, dtvalue.ToString(), cellStyle, comment);
 | 
			
		||||
                    aggregatedValues = false;
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return aggregatedValues;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddLabelCell(ExcelWorksheet worksheet, int row, int col, string value, CellStyle cellStyle = null, string comment = null)
 | 
			
		||||
        {
 | 
			
		||||
            var cell = AddValueCell(worksheet, row, col, value);
 | 
			
		||||
            ChangeStyle(cell, cellStyle ?? new CellStyle("NormalStyle"));
 | 
			
		||||
            AddComment(cell, comment);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddNumberCell(ExcelWorksheet worksheet, int row, int col, object value, CellStyle cellStyle = null, string comment = null)
 | 
			
		||||
        {
 | 
			
		||||
            var cell = AddValueCell(worksheet, row, col, value);
 | 
			
		||||
            ChangeStyle(cell, cellStyle ?? NamedCellStyles["IntegerStyle"]);
 | 
			
		||||
            AddComment(cell, comment);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddFormulaCell(ExcelWorksheet worksheet, int row, int col, string value, CellStyle cellStyle, string comment = null)
 | 
			
		||||
        {
 | 
			
		||||
            var cell = AddFormulaCell(worksheet, row, col, value);
 | 
			
		||||
            ChangeStyle(cell, cellStyle ?? NamedCellStyles["IntegerStyle"]);
 | 
			
		||||
            AddComment(cell, comment);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddAggregateFormulaCell(ExcelWorksheet worksheet, int row, int col, string aggrfunctionname, int startRow, int startCol, int endRow, int endCol, bool errorCheck = false, CellStyle cellStyle = null)
 | 
			
		||||
        {
 | 
			
		||||
            var aggregateCondition = "";
 | 
			
		||||
            if (aggrfunctionname.StartsWith("COUNTIF"))
 | 
			
		||||
            {
 | 
			
		||||
                var rx = new System.Text.RegularExpressions.Regex("[,]");
 | 
			
		||||
                var array = rx.Split(aggrfunctionname);
 | 
			
		||||
                aggrfunctionname = array[0];
 | 
			
		||||
                aggregateCondition = "," + array[1];
 | 
			
		||||
            }
 | 
			
		||||
            if (aggrfunctionname.StartsWith("IF"))
 | 
			
		||||
            {
 | 
			
		||||
                //IF,#<offset a pillanatnyi oszloptól>=<feltétel értéke>,#<offset a pillanatnyi oszloptól>,<hamis érték>
 | 
			
		||||
                var rx = new System.Text.RegularExpressions.Regex("[,]");
 | 
			
		||||
                var array = rx.Split(aggrfunctionname);
 | 
			
		||||
                rx = new System.Text.RegularExpressions.Regex("=");
 | 
			
		||||
                var condarray = rx.Split(array[1]);
 | 
			
		||||
                var form = string.Format("{0}({1}{2}{3},{4}{5},{6})", array[0], ColumnLabel(col + int.Parse(condarray[0].Substring(1))), row, "=" + condarray[1], ColumnLabel(col + int.Parse(array[2].Substring(1))), row, array[3]);
 | 
			
		||||
                if (errorCheck)
 | 
			
		||||
                    form = "IF(ISERROR(" + form + "),\"\"," + form + ")";
 | 
			
		||||
 | 
			
		||||
                AddFormulaCell(worksheet, row, col, "=" + form, cellStyle);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            string value = null;
 | 
			
		||||
            if (startCol <= endCol)
 | 
			
		||||
            {
 | 
			
		||||
                string formula = aggrfunctionname + "(" + ColumnLabel(startCol) + startRow + ":" + ColumnLabel(endCol) + endRow + aggregateCondition + ")";
 | 
			
		||||
                if (errorCheck)
 | 
			
		||||
                {
 | 
			
		||||
                    formula = "IF(ISERROR(" + formula + "),\"\"," + formula + ")";
 | 
			
		||||
                }
 | 
			
		||||
                value = "=" + formula;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            AddFormulaCell(worksheet, row, col, value, cellStyle);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddLabelRange(ExcelWorksheet worksheet, int startRow, int startCol, int endRow, int endCol, string value, CellStyle cellStyle = null, string comment = null)
 | 
			
		||||
        {
 | 
			
		||||
            var cell = AddValueRange(worksheet, startRow, startCol, endRow, endCol, value);
 | 
			
		||||
            ChangeStyle(cell, cellStyle ?? new CellStyle());
 | 
			
		||||
            AddComment(cell, comment);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddNumberRange(ExcelWorksheet worksheet, int startRow, int startCol, int endRow, int endCol, object value, CellStyle cellStyle = null, string comment = null)
 | 
			
		||||
        {
 | 
			
		||||
            var cell = AddValueRange(worksheet, startRow, startCol, endRow, endCol, value);
 | 
			
		||||
            ChangeStyle(cell, cellStyle ?? NamedCellStyles["IntegerStyle"]);
 | 
			
		||||
            AddComment(cell, comment);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected void AddFormulaRange(ExcelWorksheet worksheet, int startRow, int startCol, int endRow, int endCol, string value, CellStyle cellStyle, string comment = null)
 | 
			
		||||
        {
 | 
			
		||||
            var cell = AddFormulaRange(worksheet, startRow, startCol, endRow, endCol, value);
 | 
			
		||||
            ChangeStyle(cell, cellStyle ?? NamedCellStyles["IntegerStyle"]);
 | 
			
		||||
            AddComment(cell, comment);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected int AddDataTableCol(ExcelWorksheet worksheet, int trow, int tcol, DataTable dataTable, int dtCol, CellStyle cellStyle, string customheader = null, CellStyle headerCellStyle = null, string aggregateFunc = null, CellStyle formulaCellStyle = null)
 | 
			
		||||
        {
 | 
			
		||||
            return AddDataTableCol(worksheet, trow, tcol, dataTable, dataTable.Columns[dtCol].ToString(), cellStyle, customheader, headerCellStyle, aggregateFunc, formulaCellStyle);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected int AddDataTableCol(ExcelWorksheet worksheet, int trow, int tcol, DataTable dataTable, string dtCol, CellStyle cellStyle, string customHeader = null, CellStyle headerCellStyle = null, string aggregateFunc = null, CellStyle formulaCellStyle = null)
 | 
			
		||||
        {
 | 
			
		||||
            if (trow < 1 || tcol < 1)
 | 
			
		||||
                return 0;
 | 
			
		||||
 | 
			
		||||
            var row = 0;
 | 
			
		||||
            var rowOffset = 0;
 | 
			
		||||
 | 
			
		||||
            DataColumnCollection columns = dataTable.Columns;
 | 
			
		||||
            if (columns.Contains(dtCol))
 | 
			
		||||
            {
 | 
			
		||||
                bool aggregatedValues = false;
 | 
			
		||||
                if (customHeader != null)
 | 
			
		||||
                {
 | 
			
		||||
                    AddLabelCell(worksheet, trow, tcol, customHeader, headerCellStyle);
 | 
			
		||||
                    rowOffset++;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                for (; row < dataTable.Rows.Count; row++)
 | 
			
		||||
                    aggregatedValues = AddCellWithTypeCheck(worksheet, trow + rowOffset + row, tcol, dataTable.Rows[row][dtCol], cellStyle);
 | 
			
		||||
 | 
			
		||||
                if (aggregatedValues && row > 0 && aggregateFunc != null)
 | 
			
		||||
                    AddFormulaCell(worksheet, trow + rowOffset + row++, tcol, "=" + aggregateFunc + "(" + ColumnLabel(tcol) + (trow + rowOffset) + ":" + ColumnLabel(tcol) + (trow + rowOffset + row - 2) + ")", formulaCellStyle);
 | 
			
		||||
                else if (!aggregatedValues && row > 0 && aggregateFunc != null)
 | 
			
		||||
                    row++;
 | 
			
		||||
            }
 | 
			
		||||
            return row + rowOffset;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected int AddDataTableColTransponalt(ExcelWorksheet worksheet, int trow, int tcol, DataTable dataTable, string dtCol, CellStyle cellStyle, string customHeader = null, CellStyle headerCellStyle = null, string aggregateFunc = null, CellStyle formulaCellStyle = null)
 | 
			
		||||
        {
 | 
			
		||||
            if (trow < 1 || tcol < 1)
 | 
			
		||||
                return 0;
 | 
			
		||||
 | 
			
		||||
            var rowColl = 0;
 | 
			
		||||
            var collOffset = 0;
 | 
			
		||||
 | 
			
		||||
            DataColumnCollection columns = dataTable.Columns;
 | 
			
		||||
            if (columns.Contains(dtCol))
 | 
			
		||||
            {
 | 
			
		||||
                bool aggregatedValues = false;
 | 
			
		||||
                if (customHeader != null)
 | 
			
		||||
                {
 | 
			
		||||
                    AddLabelCell(worksheet, trow, tcol, customHeader, headerCellStyle);
 | 
			
		||||
                    collOffset++;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                for (; rowColl < dataTable.Rows.Count; rowColl++)
 | 
			
		||||
                    aggregatedValues = AddCellWithTypeCheck(worksheet, trow, tcol + collOffset + rowColl, dataTable.Rows[rowColl][dtCol], cellStyle);
 | 
			
		||||
 | 
			
		||||
                if (aggregatedValues && rowColl > 0 && aggregateFunc != null)
 | 
			
		||||
                    AddFormulaCell(worksheet, trow, tcol + collOffset + rowColl++, "=" + aggregateFunc + "(" + ColumnLabel(tcol + collOffset) + trow + ":" + ColumnLabel(tcol + collOffset + rowColl - 2) + trow + ")", formulaCellStyle);
 | 
			
		||||
                else if (!aggregatedValues && rowColl > 0 && aggregateFunc != null)
 | 
			
		||||
                    rowColl++;
 | 
			
		||||
            }
 | 
			
		||||
            return rowColl + collOffset;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected int[] AddDataTableRow(ExcelWorksheet worksheet, int trow, int tcol, DataTable dataTable, string criteria, CellStyle cellStyle, string[] dtCols = null, string aggregateFunc = null, CellStyle formulaCellStyle = null)
 | 
			
		||||
        {
 | 
			
		||||
            int[] insertDim = { 0/*rows*/, 0 /*cols*/};
 | 
			
		||||
 | 
			
		||||
            if (trow < 1 || tcol < 1)
 | 
			
		||||
                return insertDim;
 | 
			
		||||
 | 
			
		||||
            DataRow[] filteredRows = dataTable.Select(criteria);
 | 
			
		||||
            DataColumnCollection columns = dataTable.Columns;
 | 
			
		||||
            if (dtCols == null)
 | 
			
		||||
                dtCols = columns.Cast<DataColumn>().Select(x => x.ColumnName).ToArray();
 | 
			
		||||
 | 
			
		||||
            if (filteredRows.Length > 0)
 | 
			
		||||
            {
 | 
			
		||||
                bool aggregatedValues = false;
 | 
			
		||||
                insertDim[0] = filteredRows.Length;
 | 
			
		||||
 | 
			
		||||
                var col = 0;
 | 
			
		||||
                for (int row = 0; row < filteredRows.Length; row++)
 | 
			
		||||
                {
 | 
			
		||||
                    col = 0;
 | 
			
		||||
                    foreach (string dtCol in dtCols)
 | 
			
		||||
                    {
 | 
			
		||||
                        if (columns.Contains(dtCol))
 | 
			
		||||
                        {
 | 
			
		||||
                            aggregatedValues = AddCellWithTypeCheck(worksheet, trow + row, tcol + col, filteredRows[row][dtCol], cellStyle);
 | 
			
		||||
                            col++;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    if (aggregatedValues && aggregateFunc != null)
 | 
			
		||||
                    {
 | 
			
		||||
                        AddFormulaCell(worksheet, trow + row, tcol + dtCols.Length, "=" + aggregateFunc + "(" + ColumnLabel(tcol) + (trow + row) + ":" + ColumnLabel(tcol + dtCols.Length - 1) + (trow + row) + ")", formulaCellStyle);
 | 
			
		||||
                        insertDim[1]++;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                insertDim[1] = col;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return insertDim;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected int[] AddDataTable
 | 
			
		||||
        (
 | 
			
		||||
            ExcelWorksheet worksheet, int trow, int tcol, DataTable dataTable, string criteria,
 | 
			
		||||
            CellStyle cellDefaultStyle, CellStyle headerDefaultStyle, CellStyle[] cellStyles = null, CellStyle[] headerStyles = null,
 | 
			
		||||
            string[] dtCols = null,
 | 
			
		||||
            string rowAggregateFunc = null, CellStyle rowFormulaCellStyle = null,
 | 
			
		||||
            int rowHeaderOffset = 0, string[] columnAggregateFuncs = null, string[] columnAggregateFuncHeaderCol = null, CellStyle[] columnFormulaCellStyles = null, CellStyle columnFormulaCellHeaderStyles = null //ColumnAggregates
 | 
			
		||||
        )
 | 
			
		||||
        {
 | 
			
		||||
            int[] insertDim = { 0/*rows*/, 0 /*cols*/};
 | 
			
		||||
 | 
			
		||||
            if (trow < 1 || tcol < 1)
 | 
			
		||||
                return insertDim;
 | 
			
		||||
 | 
			
		||||
            DataRow[] filteredRows = dataTable.Select(criteria);
 | 
			
		||||
            DataColumnCollection columns = dataTable.Columns;
 | 
			
		||||
 | 
			
		||||
            int headerCount = 0;
 | 
			
		||||
            if (dtCols == null)
 | 
			
		||||
            {
 | 
			
		||||
                dtCols = columns.Cast<DataColumn>().Select(x => x.ColumnName).ToArray();
 | 
			
		||||
 | 
			
		||||
                headerCount = 1;
 | 
			
		||||
                int tHeaderColNum = tcol;
 | 
			
		||||
                foreach (var col in dtCols)
 | 
			
		||||
                {
 | 
			
		||||
                    AddLabelCell(worksheet, trow, tHeaderColNum, col.IndexOf("COLUMN", StringComparison.OrdinalIgnoreCase) >= 0 ? Resources.ExcelNyomtatvanyResource.ResourceManager.GetString(col.ToUpper()) : col, (headerStyles?.Length ?? 0) > (tHeaderColNum - tcol) ? headerStyles[tHeaderColNum - tcol] : headerDefaultStyle);
 | 
			
		||||
                    tHeaderColNum++;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (filteredRows.Length > 0)
 | 
			
		||||
            {
 | 
			
		||||
                bool aggregatedValues = false;
 | 
			
		||||
                insertDim[0] = headerCount + filteredRows.Length + (columnAggregateFuncs?.Length ?? 0);
 | 
			
		||||
 | 
			
		||||
                var col = 0;
 | 
			
		||||
                int row = 0;
 | 
			
		||||
                for (; row < filteredRows.Length; row++)
 | 
			
		||||
                {
 | 
			
		||||
                    col = 0;
 | 
			
		||||
                    int currentRowNum = trow + headerCount + row;
 | 
			
		||||
                    foreach (string dtCol in dtCols)
 | 
			
		||||
                    {
 | 
			
		||||
                        if (columns.Contains(dtCol))
 | 
			
		||||
                        {
 | 
			
		||||
                            aggregatedValues = AddCellWithTypeCheck(worksheet, currentRowNum, tcol + col, filteredRows[row][dtCol], (cellStyles?.Length ?? 0) > col ? cellStyles[col] : cellDefaultStyle);
 | 
			
		||||
                            col++;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    if (aggregatedValues && rowAggregateFunc != null)
 | 
			
		||||
                    {
 | 
			
		||||
                        AddFormulaCell(worksheet, currentRowNum, tcol + dtCols.Length, "=" + rowAggregateFunc + "(" + ColumnLabel(tcol) + currentRowNum + ":" + ColumnLabel(tcol + dtCols.Length - 1) + currentRowNum + ")", rowFormulaCellStyle);
 | 
			
		||||
                        insertDim[1]++;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                insertDim[1] = col;
 | 
			
		||||
 | 
			
		||||
                if (columnAggregateFuncs != null)
 | 
			
		||||
                {
 | 
			
		||||
                    for (var funcrow = 0; funcrow < columnAggregateFuncs.Length; funcrow++)
 | 
			
		||||
                    {
 | 
			
		||||
                        var formularow = trow + headerCount + row + funcrow;
 | 
			
		||||
 | 
			
		||||
                        var vaggregateFuncHeader = columnAggregateFuncHeaderCol != null && columnAggregateFuncHeaderCol.Length > funcrow ? columnAggregateFuncHeaderCol[funcrow] : null;
 | 
			
		||||
                        if (vaggregateFuncHeader != null)
 | 
			
		||||
                            AddLabelCell(worksheet, formularow, tcol, vaggregateFuncHeader, columnFormulaCellHeaderStyles ?? ((cellStyles?.Length ?? 0) > col ? cellStyles[col] : cellDefaultStyle));
 | 
			
		||||
 | 
			
		||||
                        var vaggregateFunc = columnAggregateFuncs[funcrow];
 | 
			
		||||
                        CellStyle colFormulaCellStyle = columnFormulaCellStyles != null && columnFormulaCellStyles.Length > funcrow ? columnFormulaCellStyles[funcrow] : cellDefaultStyle;
 | 
			
		||||
 | 
			
		||||
                        for (col = rowHeaderOffset; col < dtCols.Length; col++)
 | 
			
		||||
                        {
 | 
			
		||||
                            int formulacol = tcol + col;
 | 
			
		||||
                            AddAggregateFormulaCell(worksheet, formularow, formulacol, vaggregateFunc, trow + headerCount, formulacol, trow + headerCount + row - 1, formulacol, true, colFormulaCellStyle);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return insertDim;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected bool AddDataTablePivotTableCell(ExcelWorksheet worksheet, int trow, int tcol, DataTable dataTable, string criteria, CellStyle cellStyle, string[] dtCols = null, string[] dtCommentCols = null)
 | 
			
		||||
        {
 | 
			
		||||
            bool aggregatedValue = false;
 | 
			
		||||
            if (trow < 1 || tcol < 1)
 | 
			
		||||
                return aggregatedValue;
 | 
			
		||||
 | 
			
		||||
            DataRow[] filteredRows = dataTable.Select(criteria);
 | 
			
		||||
 | 
			
		||||
            if (filteredRows.Length > 0)
 | 
			
		||||
            {
 | 
			
		||||
                DataColumnCollection columns = dataTable.Columns;
 | 
			
		||||
                if (dtCols == null)
 | 
			
		||||
                    dtCols = columns.Cast<DataColumn>().Select(x => x.ColumnName).ToArray();
 | 
			
		||||
 | 
			
		||||
                for (int row = 0; row < filteredRows.Length; row++)
 | 
			
		||||
                {
 | 
			
		||||
                    var col = 0;
 | 
			
		||||
                    foreach (string dtCol in dtCols)
 | 
			
		||||
                    {
 | 
			
		||||
                        if (columns.Contains(dtCol))
 | 
			
		||||
                        {
 | 
			
		||||
                            string comment = null;
 | 
			
		||||
                            if (dtCommentCols != null)
 | 
			
		||||
                            {
 | 
			
		||||
                                foreach (string dtCommentCol in dtCommentCols)
 | 
			
		||||
                                {
 | 
			
		||||
                                    object commentValue = filteredRows[row][dtCommentCol];
 | 
			
		||||
                                    if (columns.Contains(dtCommentCol) && !(commentValue is DBNull))
 | 
			
		||||
                                        comment = (string)commentValue;
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
 | 
			
		||||
                            aggregatedValue = AddCellWithTypeCheck(worksheet, trow + row, tcol + col, filteredRows[row][dtCol], cellStyle, comment);
 | 
			
		||||
                            col++;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                aggregatedValue = AddCellWithTypeCheck(worksheet, trow, tcol, "", cellStyle);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return aggregatedValue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected int[] AddDataTablePivotTable
 | 
			
		||||
        (
 | 
			
		||||
            ExcelWorksheet worksheet, int trow, int tcol, //Worksheet
 | 
			
		||||
            DataTable dataTableHeader, string headerFilterDtCols, string headershowDtCol, //TableHeader
 | 
			
		||||
            DataTable dataTableRowHeader, string rowHeadersFilteDtCols, string[] rowHeaderDtCols, //RowHeader
 | 
			
		||||
            DataTable dataTable, //DataTable
 | 
			
		||||
            CellStyle cellStyle, CellStyle headerCellStyle = null, CellStyle rowHeaderCellStyle = null, //Styles
 | 
			
		||||
            string[] dtCols = null, string[] dtCommentCols = null, //DataTableFields
 | 
			
		||||
            string[] rowAggregateFuncs = null, string[] rowAggregateFuncHeaderCol = null, CellStyle[] rowFormulaCellStyles = null,  //RowAggregates
 | 
			
		||||
            string[] columnAggregateFuncs = null, string[] columnAggregateFuncHeaderCol = null, CellStyle[] columnFormulaCellStyles = null  //ColumnAggregates
 | 
			
		||||
        )
 | 
			
		||||
        {
 | 
			
		||||
            return AddDataTablePivotTable
 | 
			
		||||
            (
 | 
			
		||||
                worksheet, trow, tcol,
 | 
			
		||||
                dataTableHeader, headerFilterDtCols != null ? new[] { headerFilterDtCols } : null, headershowDtCol,
 | 
			
		||||
                dataTableRowHeader, rowHeadersFilteDtCols != null ? new[] { rowHeadersFilteDtCols } : null, rowHeaderDtCols,
 | 
			
		||||
                dataTable,
 | 
			
		||||
                cellStyle, headerCellStyle, rowHeaderCellStyle,
 | 
			
		||||
                dtCols, dtCommentCols,
 | 
			
		||||
                rowAggregateFuncs, rowAggregateFuncHeaderCol, rowFormulaCellStyles,
 | 
			
		||||
                columnAggregateFuncs, columnAggregateFuncHeaderCol, columnFormulaCellStyles
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected int[] AddDataTablePivotTable
 | 
			
		||||
        (
 | 
			
		||||
            ExcelWorksheet worksheet, int trow, int tcol, //Worksheet
 | 
			
		||||
            DataTable dataTableHeader, string[] headerFilterDtCols, string headershowDtCol, //TableHeader
 | 
			
		||||
            DataTable dataTableRowHeader, string[] rowHeadersFilteDtCols, string[] rowHeaderDtCols, //RowHeader
 | 
			
		||||
            DataTable dataTable, //DataTable
 | 
			
		||||
            CellStyle cellStyle, CellStyle headerCellStyle = null, CellStyle rowHeaderCellStyle = null, //Styles
 | 
			
		||||
            string[] dtCols = null, string[] dtCommentCols = null, //DataTableFields
 | 
			
		||||
            string[] rowAggregateFuncs = null, string[] rowAggregateFuncHeaderCol = null, CellStyle[] rowFormulaCellStyles = null,  //RowAggregates
 | 
			
		||||
            string[] columnAggregateFuncs = null, string[] columnAggregateFuncHeaderCol = null, CellStyle[] columnFormulaCellStyles = null //ColumnAggregates
 | 
			
		||||
        )
 | 
			
		||||
        {
 | 
			
		||||
            int[] insertDim = { 0/*rows*/, 0 /*cols*/};
 | 
			
		||||
            if (trow < 1 || tcol < 1)
 | 
			
		||||
                return insertDim;
 | 
			
		||||
 | 
			
		||||
            var rowHeaderOffset = rowHeaderDtCols?.Length ?? 0;
 | 
			
		||||
            if (headershowDtCol != null)
 | 
			
		||||
                AddDataTableColTransponalt(worksheet, trow, tcol + rowHeaderOffset, dataTableHeader, headershowDtCol, headerCellStyle ?? cellStyle);
 | 
			
		||||
            if (rowHeaderOffset > 0)
 | 
			
		||||
                AddDataTableRow(worksheet, trow + 1, tcol, dataTableRowHeader, "", rowHeaderCellStyle ?? cellStyle, rowHeaderDtCols);
 | 
			
		||||
 | 
			
		||||
            const int headerCount = 1;
 | 
			
		||||
            var row = 0;
 | 
			
		||||
            List<string> colFilters = new List<string>();
 | 
			
		||||
            /*Fejléc filterek összeállítása*/
 | 
			
		||||
            foreach (DataRow dtRow in dataTableHeader.Rows)
 | 
			
		||||
            {
 | 
			
		||||
                var colFilter = "";
 | 
			
		||||
                foreach (var headerFilterDtCol in headerFilterDtCols)
 | 
			
		||||
                {
 | 
			
		||||
                    object dtvalue = dtRow[headerFilterDtCol];
 | 
			
		||||
 | 
			
		||||
                    switch (dtvalue)
 | 
			
		||||
                    {
 | 
			
		||||
                        case int _:
 | 
			
		||||
                        case double _:
 | 
			
		||||
                        case string _ when int.TryParse((string)dtvalue, out int intDtvalue):
 | 
			
		||||
                        case string _ when double.TryParse((string)dtvalue, out double doubleDtValue):
 | 
			
		||||
                            break;
 | 
			
		||||
                        default:
 | 
			
		||||
                            dtvalue = "'" + dtvalue + "'";
 | 
			
		||||
                            break;
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    colFilter += (colFilter.Length > 0 ? " AND " : "") + headerFilterDtCol + "=" + dtvalue;
 | 
			
		||||
                }
 | 
			
		||||
                colFilters.Add(colFilter);
 | 
			
		||||
            }
 | 
			
		||||
            /*Sorok feldolgozása*/
 | 
			
		||||
            for (; row < dataTableRowHeader.Rows.Count; row++)
 | 
			
		||||
            {
 | 
			
		||||
                var rowFilter = "";
 | 
			
		||||
                foreach (var rowHeadersFilteDtCol in rowHeadersFilteDtCols)
 | 
			
		||||
                {
 | 
			
		||||
                    object dtvalue = dataTableRowHeader.Rows[row][rowHeadersFilteDtCol];
 | 
			
		||||
 | 
			
		||||
                    switch (dtvalue)
 | 
			
		||||
                    {
 | 
			
		||||
                        case int _:
 | 
			
		||||
                        case double _:
 | 
			
		||||
                        case string _ when int.TryParse((string)dtvalue, out int intDtvalue):
 | 
			
		||||
                        case string _ when double.TryParse((string)dtvalue, out double doubleDtValue):
 | 
			
		||||
                            break;
 | 
			
		||||
                        default:
 | 
			
		||||
                            dtvalue = "'" + dtvalue + "'";
 | 
			
		||||
                            break;
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    rowFilter += (rowFilter.Length > 0 ? " AND " : "") + rowHeadersFilteDtCol + "=" + dtvalue;
 | 
			
		||||
                }
 | 
			
		||||
                /*Sor adataival szűrt adattábla ellenőrzés, szűrés*/
 | 
			
		||||
                DataRow[] filteredRows = dataTable.Select(rowFilter);
 | 
			
		||||
                if (filteredRows.Length > 0)
 | 
			
		||||
                {
 | 
			
		||||
                    DataTable rowFilteredTable = filteredRows.AsEnumerable().CopyToDataTable();
 | 
			
		||||
                    /*Oszlopok összeállítása*/
 | 
			
		||||
                    var col = 0;
 | 
			
		||||
                    foreach (string colFilter in colFilters)
 | 
			
		||||
                    {
 | 
			
		||||
                        AddDataTablePivotTableCell(worksheet, trow + headerCount + row, tcol + rowHeaderOffset + col, rowFilteredTable, colFilter, cellStyle, dtCols, dtCommentCols);
 | 
			
		||||
                        col++;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    var col = 0;
 | 
			
		||||
                    foreach (string colFilter in colFilters)
 | 
			
		||||
                    {
 | 
			
		||||
                        AddCellWithTypeCheck(worksheet, trow + headerCount + row, tcol + rowHeaderOffset + col, "", cellStyle);
 | 
			
		||||
                        col++;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (rowAggregateFuncs != null)
 | 
			
		||||
                {
 | 
			
		||||
                    var formularow = trow + headerCount + row;
 | 
			
		||||
                    var formulacol = tcol + rowHeaderOffset + colFilters.Count;
 | 
			
		||||
 | 
			
		||||
                    for (int funccol = 0; funccol < rowAggregateFuncs.Length; funccol++)
 | 
			
		||||
                    {
 | 
			
		||||
                        if (rowAggregateFuncs[funccol] == null)
 | 
			
		||||
                        {
 | 
			
		||||
                            continue;
 | 
			
		||||
                        }
 | 
			
		||||
                        string aggregateFuncHeader = (rowAggregateFuncHeaderCol != null && rowAggregateFuncHeaderCol.Length > funccol ? rowAggregateFuncHeaderCol[funccol] : "");
 | 
			
		||||
                        CellStyle formulaCellStyle = (rowFormulaCellStyles != null && rowFormulaCellStyles.Length > funccol ? rowFormulaCellStyles[funccol] : cellStyle);
 | 
			
		||||
                        AddLabelCell(worksheet, trow, formulacol + funccol, aggregateFuncHeader, headerCellStyle ?? cellStyle);
 | 
			
		||||
 | 
			
		||||
                        AddAggregateFormulaCell(worksheet, formularow, formulacol + funccol, rowAggregateFuncs[funccol], formularow, tcol + rowHeaderOffset, formularow, formulacol - 1, true, formulaCellStyle);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (columnAggregateFuncs != null)
 | 
			
		||||
            {
 | 
			
		||||
                for (var funcrow = 0; funcrow < columnAggregateFuncs.Length; funcrow++)
 | 
			
		||||
                {
 | 
			
		||||
                    var formularow = trow + headerCount + row + funcrow;
 | 
			
		||||
 | 
			
		||||
                    var vaggregateFuncHeader = columnAggregateFuncHeaderCol != null && columnAggregateFuncHeaderCol.Length > funcrow ? columnAggregateFuncHeaderCol[funcrow] : "";
 | 
			
		||||
                    CellStyle formulaCellStyle = columnFormulaCellStyles != null && columnFormulaCellStyles.Length > funcrow ? columnFormulaCellStyles[funcrow] : cellStyle;
 | 
			
		||||
 | 
			
		||||
                    AddLabelCell(worksheet, formularow, tcol, vaggregateFuncHeader, rowHeaderCellStyle ?? cellStyle);
 | 
			
		||||
 | 
			
		||||
                    for (var col = 0; col < dataTableHeader.Rows.Count; col++)
 | 
			
		||||
                    {
 | 
			
		||||
                        int formulacol = tcol + rowHeaderOffset + col;
 | 
			
		||||
                        AddAggregateFormulaCell(worksheet, formularow, formulacol, columnAggregateFuncs[funcrow], trow + headerCount, formulacol, trow + headerCount + row - 1, formulacol, true, formulaCellStyle);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            insertDim[0] = row + headerCount + (columnAggregateFuncs?.Length ?? 0);
 | 
			
		||||
            insertDim[1] = rowHeaderOffset + dataTableHeader.Rows.Count + (rowAggregateFuncs?.Length ?? 0);
 | 
			
		||||
 | 
			
		||||
            return insertDim;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void GenerateNewExcelPackage(string templateFilename = null)
 | 
			
		||||
        {
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void Dispose()
 | 
			
		||||
        {
 | 
			
		||||
            ExcelPackage?.Dispose();
 | 
			
		||||
            DataSet?.Dispose();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,37 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public abstract class BaseNyomtatvanyExcelWithDataSet : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        public BaseNyomtatvanyExcelWithDataSet(IConnectionType connectionType, bool isMultisheetExcel) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public abstract void CreateSheet(DataSet ds, int osztalyId, int sheetIndex = 1);
 | 
			
		||||
 | 
			
		||||
        public MemoryStream ExcelNyomtatas(DataSet ds, int osztalyId)
 | 
			
		||||
        {
 | 
			
		||||
            if (!isMultisheetExcel)
 | 
			
		||||
            {
 | 
			
		||||
                if (ExcelPackage.Workbook.Worksheets.Count > 0)
 | 
			
		||||
                {
 | 
			
		||||
                    GenerateNewExcelPackage();
 | 
			
		||||
                    SetWorkbookProperties();
 | 
			
		||||
                }
 | 
			
		||||
                CreateSheet(ds, osztalyId);
 | 
			
		||||
            }
 | 
			
		||||
            return ExcelNyomtatas();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            throw new ApplicationException("DataSet alapúnál ez nem használható");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,268 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Kreta.BusinessLogic.Classes;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using Kreta.Resources;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
using OfficeOpenXml.Style;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class HianyzokEsJelenlevokSzama : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        private readonly CellStyle OsztalyHeaderStyle;
 | 
			
		||||
        private readonly CellStyle DarabSzamaHeaderStyle;
 | 
			
		||||
        private readonly CellStyle StartSzamHeaderStyle;
 | 
			
		||||
        private readonly CellStyle SzamHeaderStyle;
 | 
			
		||||
        private readonly CellStyle EndSzamHeaderStyle;
 | 
			
		||||
        private readonly CellStyle TopRightDoubleStyle;
 | 
			
		||||
        private readonly CellStyle TopLeftDoubleStyle;
 | 
			
		||||
        private readonly CellStyle TopDoubleStyle;
 | 
			
		||||
        private readonly CellStyle LeftDoubleStyle;
 | 
			
		||||
        private readonly CellStyle RightDoubleStyle;
 | 
			
		||||
        private readonly CellStyle ThinStyle;
 | 
			
		||||
 | 
			
		||||
        private const string Gray = "#AAAAAA";
 | 
			
		||||
 | 
			
		||||
        public HianyzokEsJelenlevokSzama(IConnectionType connectionType) : base(connectionType)
 | 
			
		||||
        {
 | 
			
		||||
            StoredProcedure = "uspGetHianyzokEsJelenlevokSzama";
 | 
			
		||||
            ExcelPackage = new ExcelPackage();
 | 
			
		||||
 | 
			
		||||
            //Stílusok
 | 
			
		||||
            NamedCellStyles.Add(nameof(OsztalyHeaderStyle), OsztalyHeaderStyle =
 | 
			
		||||
                new CellStyle(nameof(OsztalyHeaderStyle))
 | 
			
		||||
                {
 | 
			
		||||
                    FontBold = true,
 | 
			
		||||
                    RightBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    BottomBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    HorizontalAlignment = ExcelHorizontalAlignment.Center,
 | 
			
		||||
                    VerticalAlignment = ExcelVerticalAlignment.Center
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(DarabSzamaHeaderStyle), DarabSzamaHeaderStyle =
 | 
			
		||||
                new CellStyle(nameof(DarabSzamaHeaderStyle))
 | 
			
		||||
                {
 | 
			
		||||
                    RightBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    BottomBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    LeftBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    TopBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    HorizontalAlignment = ExcelHorizontalAlignment.Center
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(StartSzamHeaderStyle), StartSzamHeaderStyle =
 | 
			
		||||
                new CellStyle(nameof(StartSzamHeaderStyle))
 | 
			
		||||
                {
 | 
			
		||||
                    FontBold = true,
 | 
			
		||||
                    BgColorHex = Gray,
 | 
			
		||||
                    RightBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    BottomBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    LeftBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    TopBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    HorizontalAlignment = ExcelHorizontalAlignment.Center,
 | 
			
		||||
                    VerticalAlignment = ExcelVerticalAlignment.Center
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(SzamHeaderStyle), SzamHeaderStyle = new CellStyle(nameof(SzamHeaderStyle))
 | 
			
		||||
            {
 | 
			
		||||
                FontBold = true,
 | 
			
		||||
                BgColorHex = Gray,
 | 
			
		||||
                RightBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                TopBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                HorizontalAlignment = ExcelHorizontalAlignment.Center,
 | 
			
		||||
                VerticalAlignment = ExcelVerticalAlignment.Center
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(EndSzamHeaderStyle), EndSzamHeaderStyle =
 | 
			
		||||
                new CellStyle(nameof(EndSzamHeaderStyle))
 | 
			
		||||
                {
 | 
			
		||||
                    FontBold = true,
 | 
			
		||||
                    BgColorHex = Gray,
 | 
			
		||||
                    RightBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    BottomBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    TopBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    HorizontalAlignment = ExcelHorizontalAlignment.Center,
 | 
			
		||||
                    VerticalAlignment = ExcelVerticalAlignment.Center
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(TopRightDoubleStyle), TopRightDoubleStyle =
 | 
			
		||||
                new CellStyle(nameof(TopRightDoubleStyle))
 | 
			
		||||
                {
 | 
			
		||||
                    RightBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    BottomBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    TopBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    WrapText = true
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(TopLeftDoubleStyle), TopLeftDoubleStyle =
 | 
			
		||||
                new CellStyle(nameof(TopLeftDoubleStyle))
 | 
			
		||||
                {
 | 
			
		||||
                    RightBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    BottomBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                    LeftBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                    TopBorder = ExcelBorderStyle.Double
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(TopDoubleStyle), TopDoubleStyle = new CellStyle(nameof(TopDoubleStyle))
 | 
			
		||||
            {
 | 
			
		||||
                RightBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                TopBorder = ExcelBorderStyle.Double
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(LeftDoubleStyle), LeftDoubleStyle = new CellStyle(nameof(LeftDoubleStyle))
 | 
			
		||||
            {
 | 
			
		||||
                RightBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                TopBorder = ExcelBorderStyle.Thin
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(RightDoubleStyle), RightDoubleStyle = new CellStyle(nameof(RightDoubleStyle))
 | 
			
		||||
            {
 | 
			
		||||
                RightBorder = ExcelBorderStyle.Double,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                TopBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                WrapText = true
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            NamedCellStyles.Add(nameof(ThinStyle), ThinStyle = new CellStyle(nameof(ThinStyle))
 | 
			
		||||
            {
 | 
			
		||||
                RightBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                BottomBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                LeftBorder = ExcelBorderStyle.Thin,
 | 
			
		||||
                TopBorder = ExcelBorderStyle.Thin
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
 | 
			
		||||
            var table = DataSet.Tables[0];
 | 
			
		||||
 | 
			
		||||
            var rows = table.Rows.Cast<DataRow>();
 | 
			
		||||
 | 
			
		||||
            var groupByHonapRows = rows.GroupBy(g => g["Honap"])
 | 
			
		||||
                .Select(s =>
 | 
			
		||||
                    new
 | 
			
		||||
                    {
 | 
			
		||||
                        Honap = SDAConvert.ToString(s.Key),
 | 
			
		||||
                        Data = s
 | 
			
		||||
                    }).ToList();
 | 
			
		||||
 | 
			
		||||
            var index = 1;
 | 
			
		||||
 | 
			
		||||
            foreach (var honapGroup in groupByHonapRows)
 | 
			
		||||
            {
 | 
			
		||||
                // Munkalap összeállítása
 | 
			
		||||
                var worksheet = CreateSheet(honapGroup.Honap, index, eOrientation.Landscape, true, 2);
 | 
			
		||||
 | 
			
		||||
                worksheet.Row(2).Height = 30;
 | 
			
		||||
                worksheet.Column(1).Width = 35;
 | 
			
		||||
 | 
			
		||||
                // headers
 | 
			
		||||
                AddLabelRange(worksheet, 1, 1, 2, 1, ExcelNyomtatvanyResource.Osztaly, OsztalyHeaderStyle);
 | 
			
		||||
                AddLabelRange(worksheet, 1, 2, 1, 32, ExcelNyomtatvanyResource.HianyzoTanulokSzama,
 | 
			
		||||
                    DarabSzamaHeaderStyle);
 | 
			
		||||
                AddLabelRange(worksheet, 1, 2 + 31, 1, 32 + 31, ExcelNyomtatvanyResource.JelenlevoTanulokSzama,
 | 
			
		||||
                    DarabSzamaHeaderStyle);
 | 
			
		||||
 | 
			
		||||
                // subheaders
 | 
			
		||||
                for (var i = 1; i < 32; i++)
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet.Column(1 + i).Width = 6;
 | 
			
		||||
                    worksheet.Column(1 + i + 31).Width = 6;
 | 
			
		||||
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 1 + i, i.ToString(),
 | 
			
		||||
                        i == 1 ? StartSzamHeaderStyle : i == 31 ? EndSzamHeaderStyle : SzamHeaderStyle);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 1 + i + 31, i.ToString(),
 | 
			
		||||
                        i == 1 ? StartSzamHeaderStyle : i == 31 ? EndSzamHeaderStyle : SzamHeaderStyle);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                var rowIndex = 3;
 | 
			
		||||
 | 
			
		||||
                var groupByOsztalyRows = honapGroup.Data.GroupBy(g => g["OsztalyNev"])
 | 
			
		||||
                    .Select(s =>
 | 
			
		||||
                        new
 | 
			
		||||
                        {
 | 
			
		||||
                            Osztaly = SDAConvert.ToString(s.Key),
 | 
			
		||||
                            Data = s
 | 
			
		||||
                        }).ToList();
 | 
			
		||||
 | 
			
		||||
                foreach (var osztalyGroup in groupByOsztalyRows)
 | 
			
		||||
                {
 | 
			
		||||
                    var firstRow = rowIndex == 3;
 | 
			
		||||
 | 
			
		||||
                    AddLabelCell(worksheet, rowIndex, 1, SDAConvert.ToString(osztalyGroup.Osztaly),
 | 
			
		||||
                        firstRow ? TopRightDoubleStyle : RightDoubleStyle);
 | 
			
		||||
 | 
			
		||||
                    for (var j = 1; j < 32; j++)
 | 
			
		||||
                    {
 | 
			
		||||
                        var value = osztalyGroup.Data.Where(x =>
 | 
			
		||||
                                SDAConvert.ToBooleanFromTF(x["IsTanitasiNap"]) && SDAConvert.ToInt32(x["Nap"]) == j)
 | 
			
		||||
                            .Select(s =>
 | 
			
		||||
                                new
 | 
			
		||||
                                {
 | 
			
		||||
                                    Hianyzas = SDAConvert.ToNullableInt32(s["Hianyzas"]),
 | 
			
		||||
                                    Letszam = SDAConvert.ToNullableInt32(s["Letszam"])
 | 
			
		||||
                                }).FirstOrDefault();
 | 
			
		||||
 | 
			
		||||
                        var hianyzo = value?.Letszam == null ? null : value.Hianyzas;
 | 
			
		||||
 | 
			
		||||
                        var jelenlevo = hianyzo == null
 | 
			
		||||
                            ? null
 | 
			
		||||
                            : value.Letszam - hianyzo;
 | 
			
		||||
 | 
			
		||||
                        var style = j == 1
 | 
			
		||||
                            ? firstRow ? TopLeftDoubleStyle : LeftDoubleStyle
 | 
			
		||||
                            : j == 31
 | 
			
		||||
                                ? firstRow ? TopRightDoubleStyle : RightDoubleStyle
 | 
			
		||||
                                : firstRow
 | 
			
		||||
                                    ? TopDoubleStyle
 | 
			
		||||
                                    : ThinStyle;
 | 
			
		||||
 | 
			
		||||
                        AddNumberCell(worksheet, rowIndex, 1 + j, hianyzo, style);
 | 
			
		||||
 | 
			
		||||
                        AddNumberCell(worksheet, rowIndex, 1 + j + 31, jelenlevo, style);
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    rowIndex++;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                AddLabelCell(worksheet, rowIndex, 1, AdatszolgaltatasokResource.Osszesen, RightDoubleStyle);
 | 
			
		||||
 | 
			
		||||
                // szumma
 | 
			
		||||
                for (var k = 1; k < 32; k++)
 | 
			
		||||
                {
 | 
			
		||||
                    var style = k == 1
 | 
			
		||||
                        ? LeftDoubleStyle
 | 
			
		||||
                        : k == 31
 | 
			
		||||
                            ? RightDoubleStyle
 | 
			
		||||
                            : ThinStyle;
 | 
			
		||||
 | 
			
		||||
                    AddAggregateFormulaCell(worksheet, rowIndex, 1 + k, "SUM", 3, 1 + k, rowIndex - 1, 1 + k, true,
 | 
			
		||||
                        style);
 | 
			
		||||
 | 
			
		||||
                    AddAggregateFormulaCell(worksheet, rowIndex, 1 + k + 31, "SUM", 3, 1 + k + 31, rowIndex - 1,
 | 
			
		||||
                        1 + k + 31, true, style);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                index++;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,251 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class OsztalyStatisztika : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        private bool IsMagatartasSzorgalomNemLatszik { get; } = false;
 | 
			
		||||
 | 
			
		||||
        public OsztalyStatisztika(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFilename = null, bool isMagatartasSzorgalomNemLatszik = false) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            StoredProcedure = "uspNyomtatvany_Excel_IdoszakiOsztalyStatisztika";
 | 
			
		||||
            IsMagatartasSzorgalomNemLatszik = isMagatartasSzorgalomNemLatszik;
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            dbParameters.TryGetValue("pElmeletgyakorlat", out var elmeletGyakorlat);
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(elmeletGyakorlat))
 | 
			
		||||
            {
 | 
			
		||||
                elmeletGyakorlat = "0";
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            dbParameters.TryGetValue("pErtekelestipusaId", out var ertekelesTipusaId);
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(ertekelesTipusaId))
 | 
			
		||||
            {
 | 
			
		||||
                ertekelesTipusaId = Convert.ToString(Enums.ErtekelesTipusEnum.evvegi_jegy_ertekeles);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
            DataAccessManual.Util.DataAccessBase.SetBoolFields(DataSet.Tables[8], "OJCSJKeresztfeleves,OJTechnikaiOsztaly,OJNemzetisegi,OJKettannyelvu,OJNyelviElokeszito,OJIsGyogypedagogiaiLogopediai,OJSportOsztaly,OJAranyJanosProgram");
 | 
			
		||||
            var osztalyDt = DataSet.Tables[0];
 | 
			
		||||
            var tanuloDt = DataSet.Tables[1];
 | 
			
		||||
            var tantargyakDt = DataSet.Tables[2];
 | 
			
		||||
            var ertekelesDt = DataSet.Tables[3];
 | 
			
		||||
            var magszorgDt = DataSet.Tables[4];
 | 
			
		||||
            var mulasztasDt = DataSet.Tables[5];
 | 
			
		||||
            var mulasztasSumDt = DataSet.Tables[6];
 | 
			
		||||
            var tanoraiFeljegyzesDt = DataSet.Tables[7];
 | 
			
		||||
            var szamossagDT = DataSet.Tables[9];
 | 
			
		||||
 | 
			
		||||
            //Munkalap összeállítása
 | 
			
		||||
            var worksheet = CreateSheet(isMultisheetExcel ? osztalyDt.Rows[0]["C_NEV"].ToString() : Resources.ExcelNyomtatvanyResource.ResourceManager.GetString("OsztalyStatisztikaMunkalapnev_" + ertekelesTipusaId), sheetIndex, eOrientation.Landscape, true);
 | 
			
		||||
            worksheet.Row(1).Height = 15;
 | 
			
		||||
            worksheet.Row(2).Height = 120;
 | 
			
		||||
            worksheet.Column(1).Width = 30;
 | 
			
		||||
 | 
			
		||||
            //Hiányzó fejlécek beállítása
 | 
			
		||||
            AddTanuloAdatokFejlec(worksheet, 2);
 | 
			
		||||
 | 
			
		||||
            for (var targycol = 2; targycol < tantargyakDt.Rows.Count + 2 + 3 + (elmeletGyakorlat.Equals("0") ? 8 : 14); targycol++)
 | 
			
		||||
            {
 | 
			
		||||
                worksheet.Column(targycol).Width = 6;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            AddLabelRange(worksheet, 1, 1, 1, 2, Resources.ExcelNyomtatvanyResource.ResourceManager.GetString("OsztalyStatisztikaDokumentumNev_" + ertekelesTipusaId), DocnameStyle);
 | 
			
		||||
 | 
			
		||||
            worksheet.Column(2).Width = 13;
 | 
			
		||||
 | 
			
		||||
            AddLabelCell(worksheet, 1, 3, "", DocheaderStyle1);
 | 
			
		||||
            AddLabelRange(worksheet, 1, 4, 1, 4/*Magatartás szorgalom*/ + tantargyakDt.Rows.Count + 1 + (elmeletGyakorlat.Equals("0") ? 8 : 14), osztalyDt.Rows[0]["C_NEV"].ToString(), DocheaderStyle2);
 | 
			
		||||
 | 
			
		||||
            int[] retDimErtekeles;
 | 
			
		||||
            string[] adatMezo;
 | 
			
		||||
            string[] megjegyzesMezo;
 | 
			
		||||
 | 
			
		||||
            if (IsMagatartasSzorgalomNemLatszik)
 | 
			
		||||
            {
 | 
			
		||||
                adatMezo = new string[] { "ERTEKELES" };
 | 
			
		||||
                megjegyzesMezo = new string[] { "ERTEKELES_SZOVEG_MEGJEGYZES" };
 | 
			
		||||
                retDimErtekeles = AddDataTablePivotTable(worksheet, 2, 1, tantargyakDt, "C_TANTARGYID", "TANTARGY_NEV", tanuloDt, "C_TANULOID", new[] { "TANULONEV", "OKTATASIAZONOSITO" }, ertekelesDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, megjegyzesMezo, new[] { "AVERAGE", "IF,#3=0,#-1,1", null, null, "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanulmanyiAtlag, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanulmanyiAtlag2, null, null, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaBukasokSzama }, new[] { Numeric2BoldStyleBottomBordered, Numeric2BoldStyleBottomBordered, null, null, IntegerBoldStyleBottomBordered }, new[] { "AVERAGE", "COUNTIF,5", "COUNTIF,4", "COUNTIF,3", "COUNTIF,2", "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTantargyiAtlag, "5", "4", "3", "2", "1" }, new[] { Numeric2BoldStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered });
 | 
			
		||||
                retDimErtekeles[1] -= 4;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                //Értékelés statisztika hozzáadása
 | 
			
		||||
                var magatartasHeaderDtCreatorArray = new List<string[]>
 | 
			
		||||
                    {
 | 
			
		||||
                        new[] { "id", "name", "torolt" },
 | 
			
		||||
                        new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaMagatartas, "F" }
 | 
			
		||||
                    };
 | 
			
		||||
                AddDataTablePivotTable(worksheet, 2, 1, CreateDataTable(magatartasHeaderDtCreatorArray), new[] { "TOROLT" }, "name", tanuloDt, new[] { "C_TANULOID" }, new[] { "TANULONEV", "OKTATASIAZONOSITO" }, magszorgDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { "MagatartasOsztalyzat" }, null, null, null, null, new[] { "AVERAGE", "COUNTIF,5", "COUNTIF,4", "COUNTIF,3", "COUNTIF,2", "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTantargyiAtlag, "5", "4", "3", "2", "1" }, new[] { Numeric2BoldStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
                var szorgalomHeaderDtCreatorArray = new List<string[]>
 | 
			
		||||
                    {
 | 
			
		||||
                        new[] { "id", "name", "torolt" },
 | 
			
		||||
                        new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaSzorgalom, "F" }
 | 
			
		||||
                    };
 | 
			
		||||
                AddDataTablePivotTable(worksheet, 2, 4, CreateDataTable(szorgalomHeaderDtCreatorArray), new[] { "TOROLT" }, "name", tanuloDt, new[] { "C_TANULOID" }, null, magszorgDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { "SzorgalomOsztalyzat" }, null, null, null, null, new[] { "AVERAGE", "COUNTIF,5", "COUNTIF,4", "COUNTIF,3", "COUNTIF,2", "COUNTIF,1" }, null, new[] { Numeric2BoldStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
                adatMezo = new string[] { "ERTEKELES" };
 | 
			
		||||
                megjegyzesMezo = new string[] { "ERTEKELES_SZOVEG_MEGJEGYZES" };
 | 
			
		||||
                retDimErtekeles = AddDataTablePivotTable(worksheet, 2, 5, tantargyakDt, "C_TANTARGYID", "TANTARGY_NEV", tanuloDt, "C_TANULOID", null, ertekelesDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, megjegyzesMezo, new[] { "AVERAGE", "IF,#3=0,#-1,1", null, null, "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanulmanyiAtlag, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanulmanyiAtlag2, null, null, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaBukasokSzama }, new[] { Numeric2BoldStyleBottomBordered, Numeric2BoldStyleBottomBordered, null, null, IntegerBoldStyleBottomBordered }, new[] { "AVERAGE", "COUNTIF,5", "COUNTIF,4", "COUNTIF,3", "COUNTIF,2", "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTantargyiAtlag, "5", "4", "3", "2", "1" }, new[] { Numeric2BoldStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //Átlagok átlaga
 | 
			
		||||
            AddAggregateFormulaCell(worksheet, 2 + retDimErtekeles[0] - 6, retDimErtekeles[1] + 5 - 5, "AVERAGE", 3, retDimErtekeles[1] + 5 - 5, 2 + retDimErtekeles[0] - 7, retDimErtekeles[1] + 5 - 5, true, Numeric2BoldBigerStyleBottomBordered);
 | 
			
		||||
            //Átlagok 2 átlaga
 | 
			
		||||
            AddAggregateFormulaCell(worksheet, 2 + retDimErtekeles[0] - 6, retDimErtekeles[1] + 5 - 4, "AVERAGE", 3, retDimErtekeles[1] + 5 - 4, 2 + retDimErtekeles[0] - 7, retDimErtekeles[1] + 5 - 4, true, Numeric2BoldBigerStyleBottomBordered);
 | 
			
		||||
            //Bukások száma
 | 
			
		||||
            AddAggregateFormulaCell(worksheet, 2 + retDimErtekeles[0] - 6, retDimErtekeles[1] + 5 - 1, "SUM", 3, retDimErtekeles[1] + 5 - 1, 2 + retDimErtekeles[0] - 7, retDimErtekeles[1] + 5 - 1, true, IntegerBoldStyleBottomBordered);
 | 
			
		||||
 | 
			
		||||
            //Dicséret, Kitűnő számosságok
 | 
			
		||||
            var szamossagTipusok = new List<string> { "Dicseret", "Kituno" };
 | 
			
		||||
            var szamossagTipusokNev = new List<string> { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaDicseretekSzama, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaKitunoErtekelesekSzama };
 | 
			
		||||
            var szamossagPos = 0;
 | 
			
		||||
            foreach (var szamossagTipus in szamossagTipusok)
 | 
			
		||||
            {
 | 
			
		||||
                var szamossag1DtCreatorArray = new List<string[]>
 | 
			
		||||
                {
 | 
			
		||||
                    new[] { "id", "name", "TOROLT"},
 | 
			
		||||
                    new[] { "1", szamossagTipusokNev[szamossagPos], "F" }
 | 
			
		||||
                };
 | 
			
		||||
                AddDataTablePivotTable(worksheet, 2, retDimErtekeles[1] + 5 - 3 + szamossagPos, CreateDataTable(szamossag1DtCreatorArray), new string[0], "name",
 | 
			
		||||
                    tanuloDt, new[] { "C_TANULOID" }, null, szamossagDT, IntegerBoldStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { szamossagTipus }, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
                szamossagPos++;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //Tanórai 
 | 
			
		||||
            var feljegyzesTipusok = new List<string>(new[] { "TanoraiDicseret", "FelszerelesHiany", "HaziFeladatHiany" });
 | 
			
		||||
            var feljegyzesTipusokNev = new List<string>(new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanoraiDicseret, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaFelszerelesHiany, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaHaziFeladatHiany });
 | 
			
		||||
 | 
			
		||||
            var feljegyzesPos = 0;
 | 
			
		||||
            foreach (var feljegyzesTipus in feljegyzesTipusok)
 | 
			
		||||
            {
 | 
			
		||||
                var tanoraiFeljegyzes1DtCreatorArray = new List<string[]>
 | 
			
		||||
                {
 | 
			
		||||
                    new[] { "id", "name", "TOROLT"},
 | 
			
		||||
                    new[] { "1", feljegyzesTipusokNev[feljegyzesPos], "F" }
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                AddDataTablePivotTable(worksheet, 2, retDimErtekeles[1] + 5 + feljegyzesPos, CreateDataTable(tanoraiFeljegyzes1DtCreatorArray), new[] { "TOROLT" }, "name",
 | 
			
		||||
                    tanuloDt, new[] { "C_TANULOID" }, null, tanoraiFeljegyzesDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered,
 | 
			
		||||
                    new[] { feljegyzesTipus }, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
                feljegyzesPos++;
 | 
			
		||||
            }
 | 
			
		||||
            var retDimFeljegyzes = new[] { retDimErtekeles[0], 3 };
 | 
			
		||||
 | 
			
		||||
            //Mulasztási statisztika hozzáadása
 | 
			
		||||
            var osszesHianyzasHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
            var hianyzasHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
            var kesespercHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
            var keseshianyzasHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
            var hozotthianyzasHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
            var feldolgozatlanHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
 | 
			
		||||
            var hianyzaskesespercFilter = new List<string>(new[] { "tipus_char", "c_igazolt" });
 | 
			
		||||
            var keseshianyzasFilter = new List<string>(new[] { "c_igazolt" });
 | 
			
		||||
 | 
			
		||||
            if (elmeletGyakorlat.Equals("0"))
 | 
			
		||||
            {
 | 
			
		||||
                osszesHianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt" });
 | 
			
		||||
                osszesHianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaOsszesIgazoltHianyzas, "H", "T" });
 | 
			
		||||
                osszesHianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaOsszesIgazolatlanHianyzas, "H", "F" });
 | 
			
		||||
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazoltHianyzasok, "H", "T" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazolatlanHianyzasok, "H", "F" });
 | 
			
		||||
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazoltKesesPerc, "K", "T" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazolatlanKesesPerc, "K", "F" });
 | 
			
		||||
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "c_igazolt", "c_hozott" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazoltKesesHianyzas, "T", "F" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazolatlanKesesHianyzas, "F", "F" });
 | 
			
		||||
 | 
			
		||||
                hozotthianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt" });
 | 
			
		||||
                hozotthianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaHozottIgazoltHianyzas, "H", "T" });
 | 
			
		||||
                hozotthianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaHozottIgazolatlanHianyzas, "H", "F" });
 | 
			
		||||
 | 
			
		||||
                feldolgozatlanHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt" });
 | 
			
		||||
                feldolgozatlanHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.FeldolgozatlanMulasztas, "H", "-" });
 | 
			
		||||
                feldolgozatlanHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.FeldolgozatlanKesesPerc, "K", "-" });
 | 
			
		||||
            }
 | 
			
		||||
            else if (elmeletGyakorlat.Equals("1"))
 | 
			
		||||
            {
 | 
			
		||||
                hianyzaskesespercFilter.Add("c_gyakorlati");
 | 
			
		||||
                keseshianyzasFilter.Add("c_gyakorlati");
 | 
			
		||||
 | 
			
		||||
                osszesHianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt", "c_gyakorlati" });
 | 
			
		||||
                osszesHianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaOsszesElmeletiIgazoltHianyzas, "H", "T", "F" });
 | 
			
		||||
                osszesHianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaOsszesGyakorlatiIgazoltHianyzas, "H", "T", "T" });
 | 
			
		||||
                osszesHianyzasHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaOsszesElmeletiIgazolatlanHianyzas, "H", "F", "F" });
 | 
			
		||||
                osszesHianyzasHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaOsszesGyakorlatiIgazolatlanHianyzas, "H", "F", "T" });
 | 
			
		||||
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt", "c_gyakorlati" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazoltHianyzas, "H", "T", "F" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazoltHianyzas, "H", "T", "T" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazolatlanHianyzas, "H", "F", "F" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazolatlanHianyzas, "H", "F", "T" });
 | 
			
		||||
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt", "c_gyakorlati", "c_hozott" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazoltKesesPerc, "K", "T", "F", "F" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazoltKesesPerc, "K", "T", "T", "F" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazolatlanKesesPerc, "K", "F", "F", "F" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazolatlanKesesPerc, "K", "F", "T", "F" });
 | 
			
		||||
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "c_igazolt", "c_gyakorlati", "c_hozott" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazoltKesesHianyzas, "T", "F", "F" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazoltKesesHianyzas, "T", "T", "F" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazolatlanKesesHianyzas, "F", "F", "F" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazolatlanKesesHianyzas, "F", "T", "F" });
 | 
			
		||||
 | 
			
		||||
                hozotthianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt", "c_gyakorlati", "c_hozott" });
 | 
			
		||||
                hozotthianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaHozottIgazoltHianyzas, "H", "T", "F", "T" });
 | 
			
		||||
                hozotthianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaHozottIgazolatlanHianyzas, "H", "F", "F", "T" });
 | 
			
		||||
 | 
			
		||||
                feldolgozatlanHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt", "c_gyakorlati" });
 | 
			
		||||
                feldolgozatlanHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.FeldolgozatlanElmeletiMulasztas, "H", "-", "F" });
 | 
			
		||||
                feldolgozatlanHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.FeldolgozatlanGyakorlatiMulasztas, "H", "-", "T" });
 | 
			
		||||
                feldolgozatlanHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.FeldolgozatlanElmeletiKesesPerc, "K", "-", "F" });
 | 
			
		||||
                feldolgozatlanHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.FeldolgozatlanGyakorlatiKesesPerc, "K", "-", "T" });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            adatMezo = new[] { "OSSZES_MULASZTASOK_SZAMA" };
 | 
			
		||||
            var retDimOsszesHianyzas = AddDataTablePivotTable(worksheet, 2, retDimErtekeles[1] + retDimFeljegyzes[1] + 5, CreateDataTable(osszesHianyzasHeaderDtCreatorArray), hianyzaskesespercFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "C_TANULOID" }, null, mulasztasDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            adatMezo = new[] { "MULASZTASOK_SZAMA" };
 | 
			
		||||
            var retDimHianyzas = AddDataTablePivotTable(worksheet, 2, retDimErtekeles[1] + retDimFeljegyzes[1] + retDimOsszesHianyzas[1] + 5, CreateDataTable(hianyzasHeaderDtCreatorArray), hianyzaskesespercFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "C_TANULOID" }, null, mulasztasDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            adatMezo = new[] { "KESESPERC" };
 | 
			
		||||
            var retDimKesesperc = AddDataTablePivotTable(worksheet, 2, retDimErtekeles[1] + retDimFeljegyzes[1] + retDimOsszesHianyzas[1] + retDimHianyzas[1] + 5, CreateDataTable(kesespercHeaderDtCreatorArray), hianyzaskesespercFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "C_TANULOID" }, null, mulasztasDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            adatMezo = new[] { "MULASZTASOK_SZAMA" };
 | 
			
		||||
            var retDimKesesHianyzas = AddDataTablePivotTable(worksheet, 2, retDimErtekeles[1] + retDimFeljegyzes[1] + retDimOsszesHianyzas[1] + retDimHianyzas[1] + retDimKesesperc[1] + 5, CreateDataTable(keseshianyzasHeaderDtCreatorArray), keseshianyzasFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "C_TANULOID" }, null, mulasztasSumDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            adatMezo = new[] { "HOZOTTMULASZTASOK_SZAMA" };
 | 
			
		||||
            var retDimHozottMulasztas = AddDataTablePivotTable(worksheet, 2, retDimErtekeles[1] + retDimFeljegyzes[1] + retDimOsszesHianyzas[1] + retDimHianyzas[1] + retDimKesesperc[1] + 5 + retDimKesesHianyzas[1], CreateDataTable(hozotthianyzasHeaderDtCreatorArray), hianyzaskesespercFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "C_TANULOID" }, null, mulasztasDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            adatMezo = new[] { "FELDOLGOZATLANOK_SZAMA" };
 | 
			
		||||
            AddDataTablePivotTable(worksheet, 2, retDimErtekeles[1] + retDimFeljegyzes[1] + retDimOsszesHianyzas[1] + retDimHianyzas[1] + retDimKesesperc[1] + 5 + retDimKesesHianyzas[1] + retDimHozottMulasztas[1], CreateDataTable(feldolgozatlanHeaderDtCreatorArray), hianyzaskesespercFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "C_TANULOID" }, null, mulasztasDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,83 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using Kreta.BusinessLogic.Classes;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using Kreta.Enums.ManualEnums;
 | 
			
		||||
using Kreta.Framework.Util;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class OsztalyTanuloinakHaviMulasztasiOsszesitoje : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        public OsztalyTanuloinakHaviMulasztasiOsszesitoje(IConnectionType connectionType, string templateFilename = null) : base(connectionType)
 | 
			
		||||
        {
 | 
			
		||||
            StoredProcedure = "sp_GetOsztalyTanuloinakHaviMulasztasaiOsszesitoje";
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            dbParameters.TryGetValue("pElmeletgyakorlat", out string elmeletGyakorlat);
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(elmeletGyakorlat))
 | 
			
		||||
                elmeletGyakorlat = "0";
 | 
			
		||||
 | 
			
		||||
            dbParameters.TryGetValue("pMulasztandoOrakszamaTeljesNaposMulasztashoz", out string pMulasztandoOrakszamaTeljesNaposMulasztashoz);
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(pMulasztandoOrakszamaTeljesNaposMulasztashoz))
 | 
			
		||||
                pMulasztandoOrakszamaTeljesNaposMulasztashoz = "4";
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
            DataAccessManual.Util.DataAccessBase.SetBoolFields(DataSet.Tables[13], "OJCSJKeresztfeleves,OJTechnikaiOsztaly,OJNemzetisegi,OJKettannyelvu,OJNyelviElokeszito,OJIsGyogypedagogiaiLogopediai,OJSportOsztaly,OJAranyJanosProgram");
 | 
			
		||||
 | 
			
		||||
            DataSet.Tables[DataSet.Tables.Count - 1].TableName = "TanulokIktatasiAdatok";
 | 
			
		||||
            DataSet.Tables[DataSet.Tables.Count - 2].TableName = "OsztalyIktatasiAdatok";
 | 
			
		||||
 | 
			
		||||
            DataTable honapokDt = DataSet.Tables[0];
 | 
			
		||||
            int index = 1;
 | 
			
		||||
            foreach (DataRow honap in honapokDt.Rows)
 | 
			
		||||
            {
 | 
			
		||||
                //Munkalap összeállítása
 | 
			
		||||
                ExcelWorksheet worksheet = CreateSheet(SDAConvert.ToString(honap["honapnev"]), index, eOrientation.Landscape, true, 2);
 | 
			
		||||
                worksheet.Row(1).Height = elmeletGyakorlat.Equals("0") ? 30 : 45;
 | 
			
		||||
                worksheet.Column(1).Width = 25;
 | 
			
		||||
                worksheet.Column(2).Width = 13;
 | 
			
		||||
 | 
			
		||||
                int dcol = 3;
 | 
			
		||||
                for (; dcol <= (elmeletGyakorlat.Equals("0") ? 31 + 1 : 62 + 1); dcol++)
 | 
			
		||||
                    worksheet.Column(dcol).Width = 6;
 | 
			
		||||
 | 
			
		||||
                int[] dim = AddDataTable(
 | 
			
		||||
                    worksheet, 1, 1, DataSet.Tables[index], null, IntegerStyleBottomBordered, HeaderStyleBottomBorderedBGGray,
 | 
			
		||||
                    new[] { HeaderStyleBottomBordered, NormalStyleBottomBordered }, new[] { HeaderStyleBottomBordered },
 | 
			
		||||
                    null, null, null,
 | 
			
		||||
                    2, new[] { "COUNT", "SUM" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakHaviMulasztasiOsszesitojeNapiHianyzoTanulok, Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakHaviMulasztasiOsszesitojeNapiOsszesito }, new[] { IntegerBoldStyle, IntegerStyle }, HeaderStyle);
 | 
			
		||||
 | 
			
		||||
                for (; dcol <= dim[1]; dcol++)
 | 
			
		||||
                    worksheet.Column(dcol).Width = 11;
 | 
			
		||||
 | 
			
		||||
                if (dim[1] > 0)
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet.Column(dim[1]).Width = 15;
 | 
			
		||||
                    AddComment(worksheet, 1, dim[1], ">= " + FrameworkEnumExtensions.EnumToListManual<TeljesNaposMulasztasSzamitashozMiminalisanMulasztottOrakszamaModEnum>()[pMulasztandoOrakszamaTeljesNaposMulasztashoz]);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                //Hiányzó fejlécek beállítása
 | 
			
		||||
                AddTanuloAdatokFejlec(worksheet, 1);
 | 
			
		||||
 | 
			
		||||
                index++;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,74 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class OsztalyTanuloinakMulasztasiGyakorlatiSzazalekStatisztika : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        public OsztalyTanuloinakMulasztasiGyakorlatiSzazalekStatisztika(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFilename = null) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            StoredProcedure = "sp_Nyomtatvany_Excel_OsztalyTanuloinakGyakorlatiOraMulasztasiSzazalekStatisztika";
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
            DataAccessManual.Util.DataAccessBase.SetBoolFields(DataSet.Tables[4], "OJCSJKeresztfeleves,OJTechnikaiOsztaly,OJNemzetisegi,OJKettannyelvu,OJNyelviElokeszito,OJIsGyogypedagogiaiLogopediai,OJSportOsztaly,OJAranyJanosProgram");
 | 
			
		||||
 | 
			
		||||
            DataTable tanulosDt = DataSet.Tables[0];
 | 
			
		||||
            DataTable tantargyDt = DataSet.Tables[1];
 | 
			
		||||
            DataTable mulasztasSzazalekDt = DataSet.Tables[2];
 | 
			
		||||
            DataTable mulasztasGyakSzazalekDt = DataSet.Tables[3];
 | 
			
		||||
            DataTable osztalyDt = DataSet.Tables[4];
 | 
			
		||||
 | 
			
		||||
            //Munkalap összeállítása
 | 
			
		||||
            ExcelWorksheet worksheet = CreateSheet((isMultisheetExcel) ? osztalyDt.Rows[0]["Osztalynev"].ToString() : Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakMulasztasiGyakorlatiSzazalekStatisztikaMunkalapnev, sheetIndex, eOrientation.Landscape, true, 2);
 | 
			
		||||
            worksheet.Row(1).Height = 120;
 | 
			
		||||
            worksheet.Column(1).Width = 30;
 | 
			
		||||
            worksheet.Column(2).Width = 13;
 | 
			
		||||
            worksheet.View.FreezePanes(2, 2);
 | 
			
		||||
            for (int col = 2; col <= tantargyDt.Columns.Count; col++)
 | 
			
		||||
                worksheet.Column(col + 1).Width = 7;
 | 
			
		||||
 | 
			
		||||
            int[] retDim = AddDataTablePivotTable(worksheet, 1, 1,
 | 
			
		||||
                 tantargyDt, "TANTARGYID", "TANTARGY_NEV",
 | 
			
		||||
                 tanulosDt, "TANULOID", new[] { "TANULONEV", "OKTATASIAZONOSITO" },
 | 
			
		||||
                 mulasztasSzazalekDt, PercentStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { "MulasztasArany" },
 | 
			
		||||
                 new[] { "Info" },
 | 
			
		||||
                 new[] { "AVERAGE" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakMulasztasiGyakorlatiSzazalekStatisztikaTanuloiAtlag }, new[] { PercentBoldStyleBottomBordered },
 | 
			
		||||
                 new[] { "AVERAGE" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakMulasztasiGyakorlatiSzazalekStatisztikaTantargyiAtlag }, new[] { PercentBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            var osszesitettGyakorlatiDtCreatorArray = new List<string[]>
 | 
			
		||||
            {
 | 
			
		||||
                new[] { "id", "name", "gyakorlati" },
 | 
			
		||||
                new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakMulasztasiGyakorlatiSzazalekStatisztikaOsszesitett, "T" }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            //Hiányzó fejlécek beállítása
 | 
			
		||||
            AddTanuloAdatokFejlec(worksheet, 1);
 | 
			
		||||
 | 
			
		||||
            retDim = AddDataTablePivotTable(worksheet, 1, retDim[1] + 1,
 | 
			
		||||
                 CreateDataTable(osszesitettGyakorlatiDtCreatorArray), "gyakorlati", "name",
 | 
			
		||||
                 tanulosDt, "TANULOID", null,
 | 
			
		||||
                 mulasztasGyakSzazalekDt, PercentStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { "MulasztasArany" },
 | 
			
		||||
                 new[] { "Info" },
 | 
			
		||||
                 null, null, null,
 | 
			
		||||
                 new[] { "AVERAGE" }, new[] { "" }, new[] { PercentBoldStyleBottomBordered });
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,59 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class OsztalyTanuloinakMulasztasiSzazalekStatisztika : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        public OsztalyTanuloinakMulasztasiSzazalekStatisztika(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFilename = null) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            StoredProcedure = "sp_Nyomtatvany_Excel_OsztalyTanuloinakMulasztasiSzazalekStatisztika";
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
            DataAccessManual.Util.DataAccessBase.SetBoolFields(DataSet.Tables[3], "OJCSJKeresztfeleves,OJTechnikaiOsztaly,OJNemzetisegi,OJKettannyelvu,OJNyelviElokeszito,OJIsGyogypedagogiaiLogopediai,OJSportOsztaly,OJAranyJanosProgram");
 | 
			
		||||
 | 
			
		||||
            DataTable tanulosDt = DataSet.Tables[0];
 | 
			
		||||
            DataTable tantargyDt = DataSet.Tables[1];
 | 
			
		||||
            DataTable mulasztasSzazalekDt = DataSet.Tables[2];
 | 
			
		||||
            DataTable osztalyDt = DataSet.Tables[3];
 | 
			
		||||
 | 
			
		||||
            //Munkalap összeállítása
 | 
			
		||||
            ExcelWorksheet worksheet = CreateSheet((isMultisheetExcel) ? osztalyDt.Rows[0]["Osztalynev"].ToString() : Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakMulasztasiSzazalekStatisztikaMunkalapnev, sheetIndex, eOrientation.Landscape, true, 2);
 | 
			
		||||
            worksheet.Row(1).Height = 120;
 | 
			
		||||
            worksheet.Column(1).Width = 30;
 | 
			
		||||
            worksheet.Column(2).Width = 13;
 | 
			
		||||
            worksheet.View.FreezePanes(2, 2);
 | 
			
		||||
            for (int col = 2; col <= tantargyDt.Columns.Count; col++)
 | 
			
		||||
                worksheet.Column(col + 1).Width = 7;
 | 
			
		||||
 | 
			
		||||
            //Hiányzó fejlécek beállítása
 | 
			
		||||
            AddTanuloAdatokFejlec(worksheet, 1);
 | 
			
		||||
 | 
			
		||||
            int[] retDim = AddDataTablePivotTable(worksheet, 1, 1,
 | 
			
		||||
                 tantargyDt, "TANTARGYID", "TANTARGY_NEV",
 | 
			
		||||
                 tanulosDt, "TANULOID", new[] { "TANULONEV", "OKTATASIAZONOSITO" },
 | 
			
		||||
                 mulasztasSzazalekDt, PercentStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { "MulasztasArany" },
 | 
			
		||||
                 new[] { "Info" },
 | 
			
		||||
                 new[] { "AVERAGE" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakMulasztasiSzazalekStatisztikaTanuloiAtlag }, new[] { PercentBoldStyleBottomBordered },
 | 
			
		||||
                 new[] { "AVERAGE" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakMulasztasiSzazalekStatisztikaTantargyiAtlag }, new[] { PercentBoldStyleBottomBordered });
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,67 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class OsztalyokCsoportokTantargyiStatisztika : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        public OsztalyokCsoportokTantargyiStatisztika(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFilename = null) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            StoredProcedure = "sp_Nyomtatvany_Excel_IdoszakiOsztalyokCsoportokTantargyiStatisztika";
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            dbParameters.TryGetValue("pErtekelestipusaId", out string ertekelesTipusaId);
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(ertekelesTipusaId))
 | 
			
		||||
                ertekelesTipusaId = Convert.ToString(Enums.ErtekelesTipusEnum.evvegi_jegy_ertekeles);
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
 | 
			
		||||
            DataTable ocsDt = DataSet.Tables[0];
 | 
			
		||||
            DataTable tantargyDt = DataSet.Tables[1];
 | 
			
		||||
            DataTable tantargyiAtlagDt = DataSet.Tables[2];
 | 
			
		||||
 | 
			
		||||
            DataAccessManual.Util.DataAccessBase.SetBoolFields(DataSet.Tables[3], "OJCSJKeresztfeleves,OJTechnikaiOsztaly,OJNemzetisegi,OJKettannyelvu,OJNyelviElokeszito,OJIsGyogypedagogiaiLogopediai,OJSportOsztaly,OJAranyJanosProgram");
 | 
			
		||||
            DataAccessManual.Util.DataAccessBase.SetBoolFields(DataSet.Tables[4], "OJCSJKeresztfeleves,CSJVegzosEvfolyamu");
 | 
			
		||||
 | 
			
		||||
            //Munkalap összeállítása
 | 
			
		||||
            ExcelWorksheet worksheet = CreateSheet(Resources.ExcelNyomtatvanyResource.ResourceManager.GetString("OsztalyokCsoportokTantargyiStatisztikaMunkalapnev_" + ertekelesTipusaId), sheetIndex, eOrientation.Landscape, true, 2);
 | 
			
		||||
            worksheet.Row(1).Height = 120;
 | 
			
		||||
            worksheet.Column(1).Width = 30;
 | 
			
		||||
            worksheet.Column(2).Width = 3;
 | 
			
		||||
            worksheet.View.FreezePanes(2, 3);
 | 
			
		||||
            for (int col = 3; col <= tantargyDt.Rows.Count + 3; col++)
 | 
			
		||||
                worksheet.Column(col).Width = 7;
 | 
			
		||||
 | 
			
		||||
            string[] adatMezo = { "ATLAG" };
 | 
			
		||||
            int[] retDimErtekeles = AddDataTablePivotTable(worksheet, 1, 1,
 | 
			
		||||
                tantargyDt, "TANTARGYID", "TANTARGY_NEV",
 | 
			
		||||
                ocsDt, "TECHNIKAIID", new[] { "OSZTALYCSOPORTNEV", "AKTUALISLETSZAM" },
 | 
			
		||||
                tantargyiAtlagDt, Numeric2StyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo,
 | 
			
		||||
                null,
 | 
			
		||||
                new[] { "AVERAGE" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyCsoportStatisztikaCsoportAtlag }, new[] { Numeric2BoldStyleBottomBordered },
 | 
			
		||||
                new[] { "AVERAGE" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTantargyiAtlag },
 | 
			
		||||
                new[] { Numeric2BoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            AddLabelCell(worksheet, 1, 1, Resources.ExcelNyomtatvanyResource.OsztalyCsoportStatisztikaCsoportNevek, HeaderStyleBottomBordered);
 | 
			
		||||
            AddLabelCell(worksheet, 1, 2, Resources.ExcelNyomtatvanyResource.OsztalyCsoportStatisztikaCsoportAktualisLetszam, HeaderStyle90BottomBordered);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,289 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using Kreta.Enums;
 | 
			
		||||
using Kreta.Web.Helpers.Extension;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class OsztalyokTantargyiStatisztika : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        private bool IsMagatartasSzorgalomNemLatszik { get; } = false;
 | 
			
		||||
 | 
			
		||||
        public OsztalyokTantargyiStatisztika(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFileName = null, bool isMagatartasSzorgalomNemLatszik = false) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            StoredProcedure = "sp_Nyomtatvany_Excel_IdoszakiOsztalyokTantargyiStatisztika";
 | 
			
		||||
            IsMagatartasSzorgalomNemLatszik = isMagatartasSzorgalomNemLatszik;
 | 
			
		||||
            FileInfo fileInfo = null;
 | 
			
		||||
            if (templateFileName != null)
 | 
			
		||||
            {
 | 
			
		||||
                fileInfo = new FileInfo(templateFileName);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            ExcelPackage = fileInfo == null ? new ExcelPackage() : new ExcelPackage(fileInfo);
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            dbParameters.TryGetValue("pErtekelestipusaId", out string ertekelesTipusaId);
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(ertekelesTipusaId))
 | 
			
		||||
            {
 | 
			
		||||
                ertekelesTipusaId = ErtekelesTipusEnum.evvegi_jegy_ertekeles.ToString();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
            DataTable osztalyDataTable = DataSet.Tables[0];
 | 
			
		||||
            DataTable tantargyDataTable = DataSet.Tables[1];
 | 
			
		||||
            DataTable atlagDataTable = DataSet.Tables[2];
 | 
			
		||||
            DataTable mulasztasDataTable = DataSet.Tables[3];
 | 
			
		||||
            DataTable iktatasAdatokTable = DataSet.Tables[DataSet.Tables.Count - 1]; // utolsó tábla az iktatás adatok
 | 
			
		||||
            iktatasAdatokTable.TableName = "IktatasAdatok";
 | 
			
		||||
 | 
			
		||||
            DataAccessManual.Util.DataAccessBase.SetBoolFields(iktatasAdatokTable, "OJCSJKeresztfeleves,OJTechnikaiOsztaly,OJNemzetisegi,OJKettannyelvu,OJNyelviElokeszito,OJIsGyogypedagogiaiLogopediai,OJSportOsztaly,OJAranyJanosProgram");
 | 
			
		||||
 | 
			
		||||
            //Munkalap összeállítása
 | 
			
		||||
            ExcelWorksheet worksheet = CreateSheet(Resources.ExcelNyomtatvanyResource.ResourceManager.GetString("OsztalyokTantargyiStatisztikaMunkalapnev_" + ertekelesTipusaId), sheetIndex, eOrientation.Landscape, true, 2);
 | 
			
		||||
            worksheet.Row(1).Height = 120;
 | 
			
		||||
            worksheet.Column(1).Width = 30;
 | 
			
		||||
            worksheet.Column(2).Width = 3;
 | 
			
		||||
            worksheet.View.FreezePanes(2, 3);
 | 
			
		||||
 | 
			
		||||
            bool isGyakorlati = dbParameters["pElmeletgyakorlat"] == "1";
 | 
			
		||||
 | 
			
		||||
            if (IsMagatartasSzorgalomNemLatszik)
 | 
			
		||||
            {
 | 
			
		||||
                tantargyDataTable.RemoveDataRowIfAnyColumnValueMatch("TantargyId", new List<int>() { -1, -2 });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            CreateHeaderColumns(worksheet, tantargyDataTable);
 | 
			
		||||
            CreateHeaderRows(worksheet, osztalyDataTable);
 | 
			
		||||
            CreateMulasztasHeaders(worksheet, tantargyDataTable.Rows.Count, isGyakorlati);
 | 
			
		||||
 | 
			
		||||
            FillMainData(worksheet, osztalyDataTable, tantargyDataTable, atlagDataTable);
 | 
			
		||||
            FillMulasztasData(worksheet, osztalyDataTable, mulasztasDataTable, tantargyDataTable.Rows.Count, isGyakorlati);
 | 
			
		||||
            FillAggregate(worksheet, osztalyDataTable.Rows.Count, tantargyDataTable.Rows.Count);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void CreateHeaderColumns(ExcelWorksheet worksheet, DataTable tantargyDataTable)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            worksheet.Cells[1, 1].Value = "Osztályok";
 | 
			
		||||
            worksheet.Cells[1, 1].StyleName = HeaderStyleBottomBordered.Name;
 | 
			
		||||
            worksheet.Cells[1, 2].Value = "Tanulók Száma";
 | 
			
		||||
            worksheet.Cells[1, 2].StyleName = HeaderStyle90BottomBordered.Name;
 | 
			
		||||
 | 
			
		||||
            if (tantargyDataTable.Rows.Count <= 0)
 | 
			
		||||
            {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var columnIndex = 3;
 | 
			
		||||
            foreach (DataRow dataRow in tantargyDataTable.Rows)
 | 
			
		||||
            {
 | 
			
		||||
                worksheet.Column(columnIndex).Width = 7;
 | 
			
		||||
                worksheet.Cells[1, columnIndex].Value = dataRow["TantargyNev"];
 | 
			
		||||
                worksheet.Cells[1, columnIndex].StyleName = HeaderStyle90BottomBordered.Name;
 | 
			
		||||
                columnIndex++;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void CreateHeaderRows(ExcelWorksheet worksheet, DataTable osztalyDataTable)
 | 
			
		||||
        {
 | 
			
		||||
            if (osztalyDataTable.Rows.Count <= 0)
 | 
			
		||||
            {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var rowIndex = 2;
 | 
			
		||||
            foreach (DataRow dataRow in osztalyDataTable.Rows)
 | 
			
		||||
            {
 | 
			
		||||
                worksheet.Cells[rowIndex, 1].Value = dataRow["OsztalyNev"];
 | 
			
		||||
                worksheet.Cells[rowIndex, 1].StyleName = HeaderStyleBottomBordered.Name;
 | 
			
		||||
                worksheet.Cells[rowIndex, 2].Value = dataRow["Letszam"];
 | 
			
		||||
                worksheet.Cells[rowIndex, 2].StyleName = NormalStyleBottomBordered.Name;
 | 
			
		||||
                rowIndex++;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void CreateMulasztasHeaders(ExcelWorksheet worksheet, int colNumber, bool isGyakorlati)
 | 
			
		||||
        {
 | 
			
		||||
            if (isGyakorlati)
 | 
			
		||||
            {
 | 
			
		||||
                worksheet.Cells[1, colNumber + 3].Value = "Igazolt hiányzás (elméleti)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 3].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 4].Value = "Igazolt késés (elméleti, óra)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 4].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 5].Value = "Igazolatlan hiányzás (elméleti)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 5].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 6].Value = "Igazolatlan késés (elméleti, óra)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 6].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 7].Value = "Igazolt hiányzás (gyakorlati)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 7].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 8].Value = "Igazolt késés (gyakorlati, óra)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 8].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 9].Value = "Igazolatlanhiányzás (gyakorlati) ";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 9].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 10].Value = "Igazolatlankésés (gyakorlati, óra)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 10].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                worksheet.Cells[1, colNumber + 3].Value = "Igazolt hiányzás";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 3].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 4].Value = "Igazolt késés (óra)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 4].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 5].Value = "Igazolatlan hiányzás";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 5].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
                worksheet.Cells[1, colNumber + 6].Value = "Igazolatlan késés (óra)";
 | 
			
		||||
                worksheet.Cells[1, colNumber + 6].StyleName = HeaderStyle90BottomBorderedBGGray.Name;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void FillMainData(ExcelWorksheet worksheet, DataTable osztalyDataTable, DataTable tantargyDataTable, DataTable atlagDataTable)
 | 
			
		||||
        {
 | 
			
		||||
            var rowIndex = 2;
 | 
			
		||||
            foreach (DataRow osztalyDataRow in osztalyDataTable.Rows)
 | 
			
		||||
            {
 | 
			
		||||
                var columnIndex = 3;
 | 
			
		||||
                foreach (DataRow tantargyDataRow in tantargyDataTable.Rows)
 | 
			
		||||
                {
 | 
			
		||||
                    string rowFilter = $"OsztalyId = {osztalyDataRow["OsztalyId"]} AND TantargyId = {tantargyDataRow["TantargyId"]}";
 | 
			
		||||
                    var ert = atlagDataTable.Select(rowFilter);
 | 
			
		||||
                    worksheet.Cells[rowIndex, columnIndex].StyleName = Numeric2StyleBottomBordered.Name;
 | 
			
		||||
                    if (ert.Length != 0)
 | 
			
		||||
                    {
 | 
			
		||||
                        worksheet.Cells[rowIndex, columnIndex].Value = ert[0].ItemArray[4];
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    columnIndex++;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                rowIndex++;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void FillMulasztasData(ExcelWorksheet worksheet, DataTable osztalyDataTable, DataTable mulasztasDataTable, int colNumber, bool isGyakorlati)
 | 
			
		||||
        {
 | 
			
		||||
            if (osztalyDataTable.Rows.Count <= 0)
 | 
			
		||||
            {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            string gyakorlatiFilter = "AND Gyakorlati = 'T'";
 | 
			
		||||
            string nemGyakorlatiFilter = " AND Gyakorlati = 'F'";
 | 
			
		||||
            int gyakorlatiIndex = isGyakorlati ? 1 : 0;
 | 
			
		||||
 | 
			
		||||
            var rowIndex = 2;
 | 
			
		||||
            foreach (DataRow dataRow in osztalyDataTable.Rows)
 | 
			
		||||
            {
 | 
			
		||||
                string igazoltHianyzasRowfilter = $"Tipus = {1500} AND Igazolt = 'T' AND OsztalyId = {dataRow["OsztalyId"]}";
 | 
			
		||||
                string igazoltKesesRowfilter = $"Tipus = {1499} AND Igazolt = 'T' AND OsztalyId = {dataRow["OsztalyId"]}";
 | 
			
		||||
                string igazolatlanHianyzasRowfilter = $"Tipus = {1500} AND Igazolt = 'F' AND OsztalyId = {dataRow["OsztalyId"]}";
 | 
			
		||||
                string igazolatlanKesesRowfilter = $"Tipus = {1499} AND Igazolt = 'F' AND OsztalyId = {dataRow["OsztalyId"]}";
 | 
			
		||||
                string igazoltGyakHianyzasRowfilter = $"{igazoltHianyzasRowfilter} {gyakorlatiFilter}";
 | 
			
		||||
                string igazoltGyakKesesRowfilter = $"{igazolatlanKesesRowfilter} {gyakorlatiFilter}";
 | 
			
		||||
                string igazolatlanGyakHianyzasRowfilter = $"{igazolatlanHianyzasRowfilter} {gyakorlatiFilter}";
 | 
			
		||||
                string igazolatlanGyakKesesRowfilter = $"{igazolatlanKesesRowfilter} {gyakorlatiFilter}";
 | 
			
		||||
 | 
			
		||||
                if (isGyakorlati)
 | 
			
		||||
                {
 | 
			
		||||
                    igazoltHianyzasRowfilter += nemGyakorlatiFilter;
 | 
			
		||||
                    igazolatlanKesesRowfilter += nemGyakorlatiFilter;
 | 
			
		||||
                    igazolatlanHianyzasRowfilter += nemGyakorlatiFilter;
 | 
			
		||||
                    igazolatlanKesesRowfilter += nemGyakorlatiFilter;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                var igazoltHianyzas = mulasztasDataTable.Select(igazoltHianyzasRowfilter);
 | 
			
		||||
                var igazoltKeses = mulasztasDataTable.Select(igazoltKesesRowfilter);
 | 
			
		||||
                var igazolatlanHianyzas = mulasztasDataTable.Select(igazolatlanHianyzasRowfilter);
 | 
			
		||||
                var igazolatlanKeses = mulasztasDataTable.Select(igazolatlanKesesRowfilter);
 | 
			
		||||
                DataRow[] igazoltGyakHianyzas;
 | 
			
		||||
                DataRow[] igazoltGyakKeses;
 | 
			
		||||
                DataRow[] igazolatlanGyakHianyzas;
 | 
			
		||||
                DataRow[] igazolatlanGyakKeses;
 | 
			
		||||
 | 
			
		||||
                if (isGyakorlati)
 | 
			
		||||
                {
 | 
			
		||||
                    igazoltGyakHianyzas = mulasztasDataTable.Select(igazoltGyakHianyzasRowfilter);
 | 
			
		||||
                    igazoltGyakKeses = mulasztasDataTable.Select(igazoltGyakKesesRowfilter);
 | 
			
		||||
                    igazolatlanGyakHianyzas = mulasztasDataTable.Select(igazolatlanGyakHianyzasRowfilter);
 | 
			
		||||
                    igazolatlanGyakKeses = mulasztasDataTable.Select(igazolatlanGyakKesesRowfilter);
 | 
			
		||||
 | 
			
		||||
                    worksheet.Cells[rowIndex, colNumber + 7].StyleName = IntegerStyleBottomBordered.Name;
 | 
			
		||||
                    worksheet.Cells[rowIndex, colNumber + 8].StyleName = IntegerStyleBottomBordered.Name;
 | 
			
		||||
                    worksheet.Cells[rowIndex, colNumber + 9].StyleName = IntegerStyleBottomBordered.Name;
 | 
			
		||||
                    worksheet.Cells[rowIndex, colNumber + 10].StyleName = IntegerStyleBottomBordered.Name;
 | 
			
		||||
 | 
			
		||||
                    if (igazoltGyakHianyzas.Length != 0)
 | 
			
		||||
                    {
 | 
			
		||||
                        worksheet.Cells[rowIndex, colNumber + 7].Value = igazoltGyakHianyzas[0].ItemArray[5];
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    if (igazoltGyakKeses.Length != 0)
 | 
			
		||||
                    {
 | 
			
		||||
                        worksheet.Cells[rowIndex, colNumber + 8].Value = igazoltGyakKeses[0].ItemArray[4];
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    if (igazolatlanGyakHianyzas.Length != 0)
 | 
			
		||||
                    {
 | 
			
		||||
                        worksheet.Cells[rowIndex, colNumber + 9].Value = igazolatlanGyakHianyzas[0].ItemArray[5];
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    if (igazolatlanGyakKeses.Length != 0)
 | 
			
		||||
                    {
 | 
			
		||||
                        worksheet.Cells[rowIndex, colNumber + 10].Value = igazolatlanGyakKeses[0].ItemArray[4];
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                worksheet.Cells[rowIndex, colNumber + 3].StyleName = IntegerStyleBottomBordered.Name;
 | 
			
		||||
                worksheet.Cells[rowIndex, colNumber + 4].StyleName = IntegerStyleBottomBordered.Name;
 | 
			
		||||
                worksheet.Cells[rowIndex, colNumber + 5].StyleName = IntegerStyleBottomBordered.Name;
 | 
			
		||||
                worksheet.Cells[rowIndex, colNumber + 6].StyleName = IntegerStyleBottomBordered.Name;
 | 
			
		||||
 | 
			
		||||
                if (igazoltHianyzas.Length != 0)
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet.Cells[rowIndex, colNumber + 3].Value = igazoltHianyzas[0].ItemArray[4 + gyakorlatiIndex];
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (igazoltKeses.Length != 0)
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet.Cells[rowIndex, colNumber + 4].Value = igazoltKeses[0].ItemArray[3 + gyakorlatiIndex];
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (igazolatlanHianyzas.Length != 0)
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet.Cells[rowIndex, colNumber + 5].Value = igazolatlanHianyzas[0].ItemArray[4 + gyakorlatiIndex];
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (igazolatlanKeses.Length != 0)
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet.Cells[rowIndex, colNumber + 6].Value = igazolatlanKeses[0].ItemArray[3 + gyakorlatiIndex];
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                rowIndex++;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void FillAggregate(ExcelWorksheet worksheet, int rowNumber, int colNumber)
 | 
			
		||||
        {
 | 
			
		||||
            worksheet.Cells[rowNumber + 2, 1].Value = "Tantárgyi átlagok";
 | 
			
		||||
            worksheet.Cells[rowNumber + 2, 1].StyleName = HeaderStyle.Name;
 | 
			
		||||
            string aggrfunctionname = "AVERAGE";
 | 
			
		||||
 | 
			
		||||
            for (int columnIndex = 0; columnIndex < colNumber; columnIndex++)
 | 
			
		||||
            {
 | 
			
		||||
                string formula = $"{aggrfunctionname}({ColumnLabel(columnIndex + 3)}{2}:{ColumnLabel(columnIndex + 3)}{rowNumber + 1})";
 | 
			
		||||
                formula = $"IF(ISERROR({formula}),\"\",{formula})";
 | 
			
		||||
                AddFormulaCell(worksheet, rowNumber + 2, columnIndex + 3, "=" + formula, Numeric2Style);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,88 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Kreta.BusinessLogic.Classes;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using Kreta.Resources;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class PedagogusokBeNemIrtOraiHaviBontasban : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        public PedagogusokBeNemIrtOraiHaviBontasban(IConnectionType connectionType, bool isMultisheetExcel = false) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            StoredProcedure = "uspGetNemNaplozottOrakSzama";
 | 
			
		||||
            ExcelPackage = new ExcelPackage();
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
 | 
			
		||||
            var table = DataSet.Tables[0];
 | 
			
		||||
 | 
			
		||||
            var rows = table.Rows.Cast<DataRow>();
 | 
			
		||||
 | 
			
		||||
            var groupByTanarRows = rows.GroupBy(g => g["Tanar"])
 | 
			
		||||
                .Select(s =>
 | 
			
		||||
                    new
 | 
			
		||||
                    {
 | 
			
		||||
                        Tanar = SDAConvert.ToString(s.Key),
 | 
			
		||||
                        Data = s
 | 
			
		||||
                    }).OrderBy(o => o.Tanar).ToList();
 | 
			
		||||
 | 
			
		||||
            // Munkalap összeállítása
 | 
			
		||||
            var worksheet = CreateSheet(ExcelNyomtatvanyResource.Osszesito, 1, eOrientation.Landscape, true, 2);
 | 
			
		||||
            worksheet.Column(1).Width = 35;
 | 
			
		||||
            worksheet.Column(2).Width = 13;
 | 
			
		||||
 | 
			
		||||
            AddLabelCell(worksheet, 1, 1, ExcelNyomtatvanyResource.Pedagogusok, HeaderStyleBottomBorderedBGGray);
 | 
			
		||||
            AddLabelCell(worksheet, 1, 2, NyomtatvanyokResource.OktAzon, HeaderStyleBottomBorderedBGGray);
 | 
			
		||||
 | 
			
		||||
            for (var i = 1; i < 11; i++)
 | 
			
		||||
            {
 | 
			
		||||
                worksheet.Column(2 + i).Width = 6;
 | 
			
		||||
 | 
			
		||||
                AddLabelCell(worksheet, 1, 2 + i, GetHonapTextForIndex(i), HeaderStyleBottomBorderedBGGray);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            AddLabelCell(worksheet, 1, 13, AdatszolgaltatasokResource.Osszesen, HeaderStyleBottomBorderedBGGray);
 | 
			
		||||
 | 
			
		||||
            var rowIndex = 2;
 | 
			
		||||
 | 
			
		||||
            foreach (var tanarGroup in groupByTanarRows)
 | 
			
		||||
            {
 | 
			
		||||
                AddLabelCell(worksheet, rowIndex, 1, tanarGroup.Tanar, NormalStyleBottomBordered);
 | 
			
		||||
                AddLabelCell(worksheet, rowIndex, 2, tanarGroup.Data.Select(s => SDAConvert.ToString(s["TanarOktAzon"])).FirstOrDefault(), NormalStyleBottomBordered);
 | 
			
		||||
 | 
			
		||||
                for (var i = 1; i < 11; i++)
 | 
			
		||||
                {
 | 
			
		||||
                    var value = tanarGroup.Data.Where(x => SDAConvert.ToString(x["Honap"]) == GetHonapTextForIndex(i))
 | 
			
		||||
                            .Select(s => SDAConvert.ToNullableInt32(s["Darab"])).FirstOrDefault();
 | 
			
		||||
 | 
			
		||||
                    AddNumberCell(worksheet, rowIndex, 2 + i, value, IntegerStyleBottomBordered);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                AddAggregateFormulaCell(worksheet, rowIndex, 13, "SUM", rowIndex, 2, rowIndex, 12, true, IntegerStyleBottomBordered);
 | 
			
		||||
 | 
			
		||||
                rowIndex++;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            AddLabelRange(worksheet, rowIndex, 11, rowIndex, 12, AdatszolgaltatasokResource.Osszesen, HeaderStyleBottomBorderedBGGray);
 | 
			
		||||
            AddAggregateFormulaCell(worksheet, rowIndex, 13, "SUM", 2, 13, rowIndex - 1, 13, true, IntegerStyleBottomBordered);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 09, 10, 11, 12, 01, 02, 03, 04, 05, 06
 | 
			
		||||
        private static string GetHonapTextForIndex(int index)
 | 
			
		||||
        {
 | 
			
		||||
            return (index + 8 > 12 ? index - 4 : index + 8).ToString("00");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,72 @@
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class TanuloJegyeiReszletezesExcelbe : BaseNyomtatvanyExcelWithDataSet
 | 
			
		||||
    {
 | 
			
		||||
        public TanuloJegyeiReszletezesExcelbe(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFilename = null) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(DataSet ds, int osztalyId, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet(ds);
 | 
			
		||||
            DataTable fejlecDt = DataSet.Tables[0];
 | 
			
		||||
            var dv = DataSet.Tables[1].DefaultView;
 | 
			
		||||
            dv.Sort = "TanuloNev ASC,Tantargy ASC,Datum DESC";
 | 
			
		||||
            DataTable jegyekReszletezeseDt = dv.ToTable(DataSet.Tables[1].TableName);
 | 
			
		||||
 | 
			
		||||
            //Munkalap összeállítása
 | 
			
		||||
            string osztalyNev = fejlecDt.Rows.Cast<DataRow>().First(x => (int)x["OsztalyId"] == osztalyId)["OsztalyNev"].ToString();
 | 
			
		||||
            ExcelWorksheet worksheet;
 | 
			
		||||
            int startRow = 2;
 | 
			
		||||
            if (ExcelPackage.Workbook.Worksheets.All(x => x.Name != osztalyNev))
 | 
			
		||||
            {
 | 
			
		||||
                worksheet = CreateSheet(osztalyNev, sheetIndex, eOrientation.Landscape, true);
 | 
			
		||||
                worksheet.Row(1).Height = 15;
 | 
			
		||||
                worksheet.View.FreezePanes(2, 1);
 | 
			
		||||
 | 
			
		||||
                //Fejléc kialakítása
 | 
			
		||||
                AddLabelCell(worksheet, 1, 1, "Tanuló neve", DocheaderStyle1);
 | 
			
		||||
                AddLabelCell(worksheet, 1, 2, "Tantárgy", DocheaderStyle1);
 | 
			
		||||
                AddLabelCell(worksheet, 1, 3, "Értékelő neve", DocheaderStyle1);
 | 
			
		||||
                AddLabelCell(worksheet, 1, 4, "Értékelés", DocheaderStyle1);
 | 
			
		||||
                AddLabelCell(worksheet, 1, 5, "Értékelés témája", DocheaderStyle1);
 | 
			
		||||
                AddLabelCell(worksheet, 1, 6, "Értékelés típusa", DocheaderStyle1);
 | 
			
		||||
                AddLabelCell(worksheet, 1, 7, "Értékelés módja", DocheaderStyle1);
 | 
			
		||||
                AddLabelCell(worksheet, 1, 8, "Értékelés dátuma", DocheaderStyle1);
 | 
			
		||||
                AddLabelCell(worksheet, 1, 9, "Rögzítés dátuma", DocheaderStyle1);
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                worksheet = ExcelPackage.Workbook.Worksheets.Single(x => x.Name == osztalyNev);
 | 
			
		||||
                startRow = worksheet.Dimension.End.Row + 1;
 | 
			
		||||
            }
 | 
			
		||||
            ////Értékelés hozzáadása
 | 
			
		||||
            AddDataTable(worksheet, startRow, 1, jegyekReszletezeseDt, "OsztalyId=" + osztalyId, NormalStyle, HeaderStyle, dtCols: new string[] { "TanuloNev", "Tantargy", "ErtekeloNev", "Osztalyzat", "Tema", "ErtTip", "ErtMod", "Datum", "RogzitesDatum" });
 | 
			
		||||
            worksheet.Column(1).AutoFit(18);
 | 
			
		||||
            worksheet.Column(2).AutoFit(18);
 | 
			
		||||
            worksheet.Column(3).AutoFit(18);
 | 
			
		||||
            worksheet.Column(4).AutoFit(9);
 | 
			
		||||
            worksheet.Column(5).AutoFit(18);
 | 
			
		||||
            worksheet.Column(6).AutoFit(18);
 | 
			
		||||
            worksheet.Column(7).AutoFit(18);
 | 
			
		||||
            worksheet.Column(8).AutoFit(16);
 | 
			
		||||
            worksheet.Column(9).AutoFit(16);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,193 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Kreta.BusinessLogic.Classes;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using Kreta.Resources;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class TanulokBejegyzeseiExcel : BaseNyomtatvanyExcelWithDataSet
 | 
			
		||||
    {
 | 
			
		||||
        public TanulokBejegyzeseiExcel(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFilename = null) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(DataSet ds, int osztalyId, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            SetExcelDataSet(ds);
 | 
			
		||||
            DataTable fejlecDt = DataSet.Tables[0];
 | 
			
		||||
            int startRow = 11;
 | 
			
		||||
 | 
			
		||||
            string[] columns = new string[]
 | 
			
		||||
            {
 | 
			
		||||
                "Tipus"
 | 
			
		||||
                ,"Szeptember"
 | 
			
		||||
                ,"Oktober"
 | 
			
		||||
                ,"November"
 | 
			
		||||
                ,"December"
 | 
			
		||||
                ,"Januar"
 | 
			
		||||
                ,"Februar"
 | 
			
		||||
                ,"Marcius"
 | 
			
		||||
                ,"Aprilis"
 | 
			
		||||
                ,"Majus"
 | 
			
		||||
                ,"Junius"
 | 
			
		||||
                ,"Felev"
 | 
			
		||||
                ,"Ossz"
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            var tanuloList = DataSet.Tables[1].AsEnumerable().GroupBy(r => r.Field<string>("OktAzon"));
 | 
			
		||||
 | 
			
		||||
            foreach (var tanulo in tanuloList)
 | 
			
		||||
            {
 | 
			
		||||
                bool first = true;
 | 
			
		||||
                ExcelWorksheet worksheet = null;
 | 
			
		||||
                startRow = 11;
 | 
			
		||||
                foreach (var tanuloDataRow in tanulo)
 | 
			
		||||
                {
 | 
			
		||||
                    var tanuloTable = new DataTable(tanuloDataRow["TanuloNeve"].ToString());
 | 
			
		||||
                    var tanuloId = Convert.ToInt32(tanuloDataRow["TanuloId"]);
 | 
			
		||||
                    var cellStyles = new CellStyle[]
 | 
			
		||||
                    {
 | 
			
		||||
                        NormalStyleWrapText
 | 
			
		||||
                    };
 | 
			
		||||
                    if (first)
 | 
			
		||||
                    {
 | 
			
		||||
                        worksheet = CreateSheet($"{tanuloDataRow["TanuloNeve"]} ({tanuloDataRow["OktAzon"]})", sheetIndex, eOrientation.Landscape, true);
 | 
			
		||||
                        //Fejléc
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 1, 1, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiTanuloNeve, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 6, 1, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktatasiAzonositoja, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 8, 1, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiOsztalya, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 10, 1, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiOsztalynaploSorszama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 12, 1, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiTorzslapszama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 1, 2, 5, tanuloDataRow["TanuloNeve"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 6, 2, 7, tanuloDataRow["OktAzon"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 8, 2, 9, fejlecDt.Rows[0]["OsztalyNev"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 10, 2, 11, tanuloDataRow["Sorszam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 12, 2, 13, tanuloDataRow["TorzslapSzam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 1, 3, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiAnyjaSzuleteskoriNeve, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 3, 3, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzuletesiHely, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 6, 3, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzuletesiIdo, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 8, 3, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiAllampolgarsaga, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 12, 3, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiTajSzama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 1, 4, 2, tanuloDataRow["AnyjaNeve"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 3, 4, 5, tanuloDataRow["SzulHely"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 6, 4, 7, tanuloDataRow["SzulIdo"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 8, 4, 11, tanuloDataRow["Allampolgarsaga"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 12, 4, 13, tanuloDataRow["TajSzam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 5, 1, 5, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiKepzes, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 5, 6, 5, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiDiakigazolvanySzama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 5, 10, 5, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiBeirasiNaploSzama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 5, 12, 5, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiKilepesDatuma, DocheaderStyleMergedUpperCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 6, 1, 6, 5, tanuloDataRow["Kepzes"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 6, 6, 6, 9, tanuloDataRow["DiakIgazolvanySzam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 6, 10, 6, 11, tanuloDataRow["BeirasiNaploSorszam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 6, 12, 6, 13, tanuloDataRow["KilepesDatum"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 7, 1, 7, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzocialisEsTanugyiAdatok, DocheaderStyleMergedUpperCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 8, 1, 8, 13, tanuloDataRow["SocAdat"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
 | 
			
		||||
                        if (DataSet.Tables[2].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelRange(worksheet, 10, 1, 10, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiBejegyzesekSzamaATanevFolyaman, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            //Adatok
 | 
			
		||||
                            foreach (var column in DataSet.Tables[2].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[2].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 2;
 | 
			
		||||
                        }
 | 
			
		||||
                        worksheet.Column(1).AutoFit(35);
 | 
			
		||||
                        for (var i = 2; i <= columns.Length; ++i)
 | 
			
		||||
                        {
 | 
			
		||||
                            worksheet.Column(i).AutoFit(15);
 | 
			
		||||
                        }
 | 
			
		||||
                        first = false;
 | 
			
		||||
                        sheetIndex++;
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 1, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiTanuloNeve, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 6, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktatasiAzonositoja, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 8, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiOsztalya, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 10, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiKilepesDatuma, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        startRow++;
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 1, startRow, 5, tanuloDataRow["TanuloNeve"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 6, startRow, 7, tanuloDataRow["OktAzon"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 8, startRow, 9, tanuloDataRow["AktualisOsztaly"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 10, startRow, 13, tanuloDataRow["KilepesDatum"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        startRow += 2;
 | 
			
		||||
 | 
			
		||||
                        if (DataSet.Tables[2].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiBejegyzesekSzamaATanevFolyaman, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            startRow++;
 | 
			
		||||
                            //Adatok
 | 
			
		||||
                            foreach (var column in DataSet.Tables[2].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[2].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 2;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,394 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Kreta.BusinessLogic.Classes;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using Kreta.Resources;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class TanulokGyorsbejegyzeseiExcel : BaseNyomtatvanyExcelWithDataSet
 | 
			
		||||
    {
 | 
			
		||||
        public TanulokGyorsbejegyzeseiExcel(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFilename = null) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(DataSet ds, int osztalyId, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            SetExcelDataSet(ds);
 | 
			
		||||
            DataTable fejlecDt = DataSet.Tables[0];
 | 
			
		||||
            int startRow = 11;
 | 
			
		||||
 | 
			
		||||
            string[] columns = new string[]
 | 
			
		||||
            {
 | 
			
		||||
                "Tantargy"
 | 
			
		||||
                ,"Szeptember"
 | 
			
		||||
                ,"Oktober"
 | 
			
		||||
                ,"November"
 | 
			
		||||
                ,"December"
 | 
			
		||||
                ,"Januar"
 | 
			
		||||
                ,"Februar"
 | 
			
		||||
                ,"Marcius"
 | 
			
		||||
                ,"Aprilis"
 | 
			
		||||
                ,"Majus"
 | 
			
		||||
                ,"Junius"
 | 
			
		||||
                ,"Felev"
 | 
			
		||||
                ,"Ossz"
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            var tanuloList = DataSet.Tables[1].AsEnumerable().GroupBy(r => r.Field<string>("OktAzon"));
 | 
			
		||||
 | 
			
		||||
            foreach (var tanulo in tanuloList)
 | 
			
		||||
            {
 | 
			
		||||
                bool first = true;
 | 
			
		||||
                ExcelWorksheet worksheet = null;
 | 
			
		||||
                startRow = 11;
 | 
			
		||||
                foreach (var tanuloDataRow in tanulo)
 | 
			
		||||
                {
 | 
			
		||||
                    var tanuloTable = new DataTable(tanuloDataRow["TanuloNeve"].ToString());
 | 
			
		||||
                    var tanuloId = Convert.ToInt32(tanuloDataRow["TanuloId"]);
 | 
			
		||||
                    var cellStyles = new CellStyle[]
 | 
			
		||||
                    {
 | 
			
		||||
                        NormalStyleWrapText
 | 
			
		||||
                    };
 | 
			
		||||
                    if (first)
 | 
			
		||||
                    {
 | 
			
		||||
                        worksheet = CreateSheet($"{tanuloDataRow["TanuloNeve"]} ({tanuloDataRow["OktAzon"]})", sheetIndex, eOrientation.Landscape, true);
 | 
			
		||||
 | 
			
		||||
                        //Fejléc
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 1, 1, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiTanuloNeve, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 6, 1, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktatasiAzonositoja, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 8, 1, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiOsztalya, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 10, 1, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiOsztalynaploSorszama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 1, 12, 1, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiTorzslapszama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 1, 2, 5, tanuloDataRow["TanuloNeve"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 6, 2, 7, tanuloDataRow["OktAzon"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 8, 2, 9, fejlecDt.Rows[0]["OsztalyNev"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 10, 2, 11, tanuloDataRow["Sorszam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 2, 12, 2, 13, tanuloDataRow["TorzslapSzam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 1, 3, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiAnyjaSzuleteskoriNeve, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 3, 3, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzuletesiHely, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 6, 3, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzuletesiIdo, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 8, 3, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiAllampolgarsaga, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 3, 12, 3, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiTajSzama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 1, 4, 2, tanuloDataRow["AnyjaNeve"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 3, 4, 5, tanuloDataRow["SzulHely"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 6, 4, 7, tanuloDataRow["SzulIdo"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 8, 4, 11, tanuloDataRow["Allampolgarsaga"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 4, 12, 4, 13, tanuloDataRow["TajSzam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 5, 1, 5, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiKepzes, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 5, 6, 5, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiDiakigazolvanySzama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 5, 10, 5, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiBeirasiNaploSzama, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 5, 12, 5, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiKilepesDatuma, DocheaderStyleMergedUpperCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 6, 1, 6, 5, tanuloDataRow["Kepzes"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 6, 6, 6, 9, tanuloDataRow["DiakIgazolvanySzam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 6, 10, 6, 11, tanuloDataRow["BeirasiNaploSorszam"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, 6, 12, 6, 13, tanuloDataRow["KilepesDatum"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 7, 1, 7, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzocialisEsTanugyiAdatok, DocheaderStyleMergedUpperCell);
 | 
			
		||||
 | 
			
		||||
                        AddLabelRange(worksheet, 8, 1, 8, 13, tanuloDataRow["SocAdat"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
 | 
			
		||||
                        // Adatok
 | 
			
		||||
                        // Házifeladat hiány
 | 
			
		||||
                        if (DataSet.Tables[2].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiHazifeladatHianyFeljegyzesek, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, 10, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            foreach (var column in DataSet.Tables[2].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[2].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 1;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // Felszerelés hiány
 | 
			
		||||
                        if (DataSet.Tables[3].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelszerelesHianyFeljegyzesek, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            tanuloTable = new DataTable(tanuloDataRow["TanuloNeve"].ToString());
 | 
			
		||||
                            foreach (var column in DataSet.Tables[3].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[3].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow + 1, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 2;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // Felmentés
 | 
			
		||||
                        if (DataSet.Tables[4].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelmentesFeljegyzesek, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            tanuloTable = new DataTable(tanuloDataRow["TanuloNeve"].ToString());
 | 
			
		||||
                            foreach (var column in DataSet.Tables[4].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[4].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow + 1, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 2;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // Dicséret
 | 
			
		||||
                        if (DataSet.Tables[5].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiDicseretFeljegyzesek, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            tanuloTable = new DataTable(tanuloDataRow["TanuloNeve"].ToString());
 | 
			
		||||
                            foreach (var column in DataSet.Tables[5].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[5].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow + 1, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 2;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        worksheet.Column(1).AutoFit(35);
 | 
			
		||||
                        for (var i = 2; i <= columns.Length; ++i)
 | 
			
		||||
                        {
 | 
			
		||||
                            worksheet.Column(i).AutoFit(15);
 | 
			
		||||
                        }
 | 
			
		||||
                        first = false;
 | 
			
		||||
                        sheetIndex++;
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 1, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiTanuloNeve, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 6, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktatasiAzonositoja, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 8, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiOsztalya, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 10, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiKilepesDatuma, DocheaderStyleMergedUpperCell);
 | 
			
		||||
                        startRow++;
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 1, startRow, 5, tanuloDataRow["TanuloNeve"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 6, startRow, 7, tanuloDataRow["OktAzon"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 8, startRow, 9, tanuloDataRow["AktualisOsztaly"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        AddLabelRange(worksheet, startRow, 10, startRow, 13, tanuloDataRow["KilepesDatum"].ToString(), DocheaderStyleMergedLowerCell);
 | 
			
		||||
                        startRow += 2;
 | 
			
		||||
                        // Adatok
 | 
			
		||||
                        // Házifeladat hiány
 | 
			
		||||
                        if (DataSet.Tables[2].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiHazifeladatHianyFeljegyzesek, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            foreach (var column in DataSet.Tables[2].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[2].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 1;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // Felszerelés hiány
 | 
			
		||||
                        if (DataSet.Tables[3].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelszerelesHianyFeljegyzesek, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            tanuloTable = new DataTable(tanuloDataRow["TanuloNeve"].ToString());
 | 
			
		||||
                            foreach (var column in DataSet.Tables[3].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[3].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow + 1, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 2;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // Felmentés
 | 
			
		||||
                        if (DataSet.Tables[4].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelmentesFeljegyzesek, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            tanuloTable = new DataTable(tanuloDataRow["TanuloNeve"].ToString());
 | 
			
		||||
                            foreach (var column in DataSet.Tables[4].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[4].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow + 1, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 2;
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // Dicséret
 | 
			
		||||
                        if (DataSet.Tables[5].AsEnumerable().ToList().Any(r => r.Field<int>("TanuloId") == tanuloId && SDAConvert.ToDateTime(r["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"])))
 | 
			
		||||
                        {
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 1, ExcelNyomtatvanyResource.TanulokBejegyzeseiDicseretFeljegyzesek, DocheaderStyle1);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 2, ExcelNyomtatvanyResource.TanulokBejegyzeseiSzeptember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 3, ExcelNyomtatvanyResource.TanulokBejegyzeseiOktober, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 4, ExcelNyomtatvanyResource.TanulokBejegyzeseiNovember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 5, ExcelNyomtatvanyResource.TanulokBejegyzeseiDecember, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 6, ExcelNyomtatvanyResource.TanulokBejegyzeseiJanuar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 7, ExcelNyomtatvanyResource.TanulokBejegyzeseiFebruar, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 8, ExcelNyomtatvanyResource.TanulokBejegyzeseiMarcius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 9, ExcelNyomtatvanyResource.TanulokBejegyzeseiAprilis, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 10, ExcelNyomtatvanyResource.TanulokBejegyzeseiMajus, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 11, ExcelNyomtatvanyResource.TanulokBejegyzeseiJunius, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 12, ExcelNyomtatvanyResource.TanulokBejegyzeseiFelev, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
                            AddLabelCell(worksheet, startRow, 13, ExcelNyomtatvanyResource.TanulokBejegyzeseiEvVege, DocheaderStyleCenteredWithoutBorder);
 | 
			
		||||
 | 
			
		||||
                            tanuloTable = new DataTable(tanuloDataRow["TanuloNeve"].ToString());
 | 
			
		||||
                            foreach (var column in DataSet.Tables[5].Columns)
 | 
			
		||||
                            {
 | 
			
		||||
                                tanuloTable.Columns.Add(column.ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                            foreach (DataRow bejegyzesDataRow in DataSet.Tables[5].Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (Convert.ToInt32(bejegyzesDataRow["TanuloId"]) == tanuloId && SDAConvert.ToDateTime(bejegyzesDataRow["KilepesDatum"]) == SDAConvert.ToDateTime(tanuloDataRow["KilepesDatum"]))
 | 
			
		||||
                                {
 | 
			
		||||
                                    tanuloTable.ImportRow(bejegyzesDataRow);
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                            AddDataTable(worksheet, startRow + 1, 1, tanuloTable, "", NormalStyleCentered, HeaderStyle, cellStyles: cellStyles, dtCols: columns);
 | 
			
		||||
                            startRow += tanuloTable.Rows.Count + 2;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,249 @@
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class TanulokMulasztasaiExcel : BaseNyomtatvanyExcelWithDataSet
 | 
			
		||||
    {
 | 
			
		||||
        private bool _elmeletGyakorlat = false;
 | 
			
		||||
        public TanulokMulasztasaiExcel(IConnectionType connectionType, bool isMultisheetExcel = false, string templateFilename = null, bool elmeletGyakorlat = false) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
            _elmeletGyakorlat = elmeletGyakorlat;
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(DataSet ds, int osztalyId, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet(ds);
 | 
			
		||||
            DataTable fejlecDt = DataSet.Tables[0];
 | 
			
		||||
            var dv = DataSet.Tables[1].DefaultView;
 | 
			
		||||
            dv.Sort = "OsztalyNev ASC,TanuloNev ASC";
 | 
			
		||||
            DataTable mulasztasokDt = dv.ToTable(DataSet.Tables[1].TableName);
 | 
			
		||||
 | 
			
		||||
            //Munkalap összeállítása
 | 
			
		||||
            string osztalyNev = fejlecDt.Rows.Cast<DataRow>().First(x => (int)x["OsztalyId"] == osztalyId)["OsztalyNev"].ToString();
 | 
			
		||||
            ExcelWorksheet worksheet;
 | 
			
		||||
            int startRow = 2;
 | 
			
		||||
            if (ExcelPackage.Workbook.Worksheets.All(x => x.Name != osztalyNev))
 | 
			
		||||
            {
 | 
			
		||||
                if (_elmeletGyakorlat)
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet = CreateSheet(osztalyNev, sheetIndex, eOrientation.Landscape, true);
 | 
			
		||||
                    worksheet.Row(1).Height = 15;
 | 
			
		||||
                    worksheet.Row(2).Height = 15;
 | 
			
		||||
                    worksheet.Row(3).Height = 15;
 | 
			
		||||
                    worksheet.View.FreezePanes(4, 2);
 | 
			
		||||
 | 
			
		||||
                    //Fejléc kialakítása
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 1, 3, 1, "Tanuló neve", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 2, 3, 2, "Oktatási azonosító", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 3, 3, 3, "Osztály", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 4, 1, 18, "Gyakorlati", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 19, 1, 37, "Elméleti", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 38, 2, 48, "Igazolások típusa", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 4, 2, 6, "Tanórai hiányzás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 7, 2, 9, "Tanórán kívüli hiányzás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 10, 2, 12, "Tanórai késések száma", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 13, 2, 15, "Tanóráról késett percek száma", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 16, 2, 18, "Tanóráról késett órák", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 19, 2, 21, "Tanórai hiányzás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 22, 2, 24, "Tanórán kívüli hiányzás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 25, 2, 27, "Tanórai késések száma", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 28, 2, 30, "Tanóráról késett percek száma", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 31, 2, 33, "Tanóráról késett órák", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 34, 2, 35, "Hozott hiányzás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 2, 36, 2, 37, "Hozott késett perc", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                    for (int i = 0; i < 10; ++i)
 | 
			
		||||
                    {
 | 
			
		||||
                        AddLabelCell(worksheet, 3, 4 + (i * 3), "Igazolandó", DocheaderStyleSideBordered);
 | 
			
		||||
                        AddLabelCell(worksheet, 3, 5 + (i * 3), "Igazolt", DocheaderStyleSideBordered);
 | 
			
		||||
                        AddLabelCell(worksheet, 3, 6 + (i * 3), "Igazolatlan", DocheaderStyleSideBordered);
 | 
			
		||||
                    }
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 34, "Igazolt", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 35, "Igazolatlan", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 36, "Igazolt", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 37, "Igazolatlan", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 38, "Orvosi igazolás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 39, "Gondviselői igazolás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 40, "Hivatalos távollét", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 41, "Iskolaérdekű távollét", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 42, "Szolgáltatói igazolás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 43, "Iskolai engedély", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 44, "Pályaválasztási célú igazolás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 45, "Kikérő", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 46, "Táppénz", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 47, "Hatósági házi karantén", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 3, 48, "Egyéb", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    worksheet = CreateSheet(osztalyNev, sheetIndex, eOrientation.Landscape, true);
 | 
			
		||||
                    worksheet.Row(1).Height = 15;
 | 
			
		||||
                    worksheet.Row(2).Height = 15;
 | 
			
		||||
                    worksheet.View.FreezePanes(3, 2);
 | 
			
		||||
 | 
			
		||||
                    //Fejléc kialakítása
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 1, 2, 1, "Tanuló neve", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 2, 2, 2, "Oktatási azonosító", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 3, 2, 3, "Osztály", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 4, 1, 6, "Tanórai hiányzás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 7, 1, 9, "Tanórán kívüli hiányzás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 10, 1, 12, "Tanórai késések száma", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 13, 1, 15, "Tanóráról késett percek száma", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 16, 1, 18, "Tanóráról késett órák", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 19, 1, 20, "Hozott hiányzás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 21, 1, 22, "Hozott késett perc", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelRange(worksheet, 1, 23, 1, 33, "Igazolások típusa", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                    for (int i = 0; i < 5; ++i)
 | 
			
		||||
                    {
 | 
			
		||||
                        AddLabelCell(worksheet, 2, 4 + (i * 3), "Igazolandó", DocheaderStyleSideBordered);
 | 
			
		||||
                        AddLabelCell(worksheet, 2, 5 + (i * 3), "Igazolt", DocheaderStyleSideBordered);
 | 
			
		||||
                        AddLabelCell(worksheet, 2, 6 + (i * 3), "Igazolatlan", DocheaderStyleSideBordered);
 | 
			
		||||
                    }
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 19, "Igazolt", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 20, "Igazolatlan", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 21, "Igazolt", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 22, "Igazolatlan", DocheaderStyleSideBordered);
 | 
			
		||||
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 23, "Orvosi igazolás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 24, "Gondviselői igazolás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 25, "Hivatalos távollét", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 26, "Iskolaérdekű távollét", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 27, "Szolgáltatói igazolás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 28, "Iskolai engedély", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 29, "Pályaválasztási célú igazolás", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 30, "Kikérő", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 31, "Táppénz", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 32, "Hatósági házi karantén", DocheaderStyleSideBordered);
 | 
			
		||||
                    AddLabelCell(worksheet, 2, 33, "Egyéb", DocheaderStyleSideBordered);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                worksheet = ExcelPackage.Workbook.Worksheets.Single(x => x.Name == osztalyNev);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            startRow = worksheet.Dimension.End.Row + 1;
 | 
			
		||||
            string[] columns;
 | 
			
		||||
            if (_elmeletGyakorlat)
 | 
			
		||||
            {
 | 
			
		||||
                columns = new string[]
 | 
			
		||||
                {
 | 
			
		||||
                      "TanuloNev"
 | 
			
		||||
                    , "TanuloOktAzon"
 | 
			
		||||
                    , "OsztalyNev"
 | 
			
		||||
                    , "TanoraiHianyzasIgazolandoGyakorlati"
 | 
			
		||||
                    , "TanoraiHianyzasIgazoltGyakorlati"
 | 
			
		||||
                    , "TanoraiHianyzasIgazolatlanGyakorlati"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazolandoGyakorlati"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazoltGyakorlati"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazolatlanGyakorlati"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazolandoGyakorlati"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazoltGyakorlati"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazolatlanGyakorlati"
 | 
			
		||||
                    , "TanoraiKesesIgazolandoGyakorlatiPerc"
 | 
			
		||||
                    , "TanoraiKesesIgazoltGyakorlatiPerc"
 | 
			
		||||
                    , "TanoraiKesesIgazolatlanGyakorlatiPerc"
 | 
			
		||||
                    , "SzamitottKesesIgazolandoGyakorlati"
 | 
			
		||||
                    , "SzamitottKesesIgazoltGyakorlati"
 | 
			
		||||
                    , "SzamitottKesesIgazolatlanGyakorlati"
 | 
			
		||||
                    , "TanoraiHianyzasIgazolandoElmeleti"
 | 
			
		||||
                    , "TanoraiHianyzasIgazoltElmeleti"
 | 
			
		||||
                    , "TanoraiHianyzasIgazolatlanElmeleti"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazolandoElmeleti"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazoltElmeleti"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazolatlanElmeleti"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazolandoElmeleti"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazoltElmeleti"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazolatlanElmeleti"
 | 
			
		||||
                    , "TanoraiKesesIgazolandoElmeletiPerc"
 | 
			
		||||
                    , "TanoraiKesesIgazoltElmeletiPerc"
 | 
			
		||||
                    , "TanoraiKesesIgazolatlanElmeletiPerc"
 | 
			
		||||
                    , "SzamitottKesesIgazolandoElmeleti"
 | 
			
		||||
                    , "SzamitottKesesIgazoltElmeleti"
 | 
			
		||||
                    , "SzamitottKesesIgazolatlanElmeleti"
 | 
			
		||||
                    , "HozottIgazoltHianyzas"
 | 
			
		||||
                    , "HozottIgazolatlanHianyzas"
 | 
			
		||||
                    , "HozottIgazoltHianyzasPerc"
 | 
			
		||||
                    , "HozottIgazolatlanKesesPerc"
 | 
			
		||||
                    , "OrvosiIgazolas"
 | 
			
		||||
                    , "SzuloiIgazolas"
 | 
			
		||||
                    , "HivatalosTavolletIgazolas"
 | 
			
		||||
                    , "IskolaerdekuTavolletIgazolas"
 | 
			
		||||
                    , "SzolgaltatoiIgazolas"
 | 
			
		||||
                    , "IskolaiEngedelyIgazolas"
 | 
			
		||||
                    , "PalyavalasztasiCeluIgazolas"
 | 
			
		||||
                    , "KikeroIgazolas"
 | 
			
		||||
                    , "TappenzIgazolas"
 | 
			
		||||
                    , "HatosagiHaziKaranten"
 | 
			
		||||
                    , "EgyebIgazolas"
 | 
			
		||||
                };
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                columns = new string[]
 | 
			
		||||
                {
 | 
			
		||||
                      "TanuloNev"
 | 
			
		||||
                    , "TanuloOktAzon"
 | 
			
		||||
                    , "OsztalyNev"
 | 
			
		||||
                    , "TanoraiHianyzasIgazolando"
 | 
			
		||||
                    , "TanoraiHianyzasIgazolt"
 | 
			
		||||
                    , "TanoraiHianyzasIgazolatlan"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazolando"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazolt"
 | 
			
		||||
                    , "TanoranKivuliHianyzasIgazolatlan"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazolando"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazolt"
 | 
			
		||||
                    , "TanoraiKesesDarabszamIgazolatlan"
 | 
			
		||||
                    , "TanoraiKesesIgazolandoPerc"
 | 
			
		||||
                    , "TanoraiKesesIgazoltPerc"
 | 
			
		||||
                    , "TanoraiKesesIgazolatlanPerc"
 | 
			
		||||
                    , "SzamitottKesesIgazolando"
 | 
			
		||||
                    , "SzamitottKesesIgazolt"
 | 
			
		||||
                    , "SzamitottKesesIgazolatlan"
 | 
			
		||||
                    , "HozottIgazoltHianyzas"
 | 
			
		||||
                    , "HozottIgazolatlanHianyzas"
 | 
			
		||||
                    , "HozottIgazoltHianyzasPerc"
 | 
			
		||||
                    , "HozottIgazolatlanKesesPerc"
 | 
			
		||||
                    , "OrvosiIgazolas"
 | 
			
		||||
                    , "SzuloiIgazolas"
 | 
			
		||||
                    , "HivatalosTavolletIgazolas"
 | 
			
		||||
                    , "IskolaerdekuTavolletIgazolas"
 | 
			
		||||
                    , "SzolgaltatoiIgazolas"
 | 
			
		||||
                    , "IskolaiEngedelyIgazolas"
 | 
			
		||||
                    , "PalyavalasztasiCeluIgazolas"
 | 
			
		||||
                    , "KikeroIgazolas"
 | 
			
		||||
                    , "TappenzIgazolas"
 | 
			
		||||
                    , "HatosagiHaziKaranten"
 | 
			
		||||
                    , "EgyebIgazolas"
 | 
			
		||||
                };
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            AddDataTable(worksheet, startRow, 1, mulasztasokDt, "OsztalyId=" + osztalyId, NormalStyle, HeaderStyle, dtCols: columns);
 | 
			
		||||
            worksheet.Column(1).AutoFit(18);
 | 
			
		||||
            for (var i = 2; i <= mulasztasokDt.Columns.Count; ++i)
 | 
			
		||||
            {
 | 
			
		||||
                worksheet.Column(i).AutoFit(11);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,241 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using OfficeOpenXml;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
 | 
			
		||||
{
 | 
			
		||||
    public class TanulokTantargyiStatisztika : BaseNyomtatvanyExcel
 | 
			
		||||
    {
 | 
			
		||||
        private List<int> osztalyFilterIds { get; set; }
 | 
			
		||||
        private bool IsMagatartasSzorgalomNemLatszik { get; } = false;
 | 
			
		||||
 | 
			
		||||
        public TanulokTantargyiStatisztika(IConnectionType connectionType, List<int> osztalyFilterIds, bool isMultisheetExcel = false, string templateFilename = null, bool isMagatartasSzorgalomNemLatszik = false) : base(connectionType, isMultisheetExcel)
 | 
			
		||||
        {
 | 
			
		||||
            this.osztalyFilterIds = osztalyFilterIds;
 | 
			
		||||
            StoredProcedure = "sp_Nyomtatvany_Excel_IdoszakiTanuloStatisztika";
 | 
			
		||||
            IsMagatartasSzorgalomNemLatszik = isMagatartasSzorgalomNemLatszik;
 | 
			
		||||
            FileInfo exFile = null;
 | 
			
		||||
            if (templateFilename != null)
 | 
			
		||||
            {
 | 
			
		||||
                exFile = new FileInfo(templateFilename);
 | 
			
		||||
            }
 | 
			
		||||
            ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
 | 
			
		||||
 | 
			
		||||
            //Munkalap tulajdonságok beállítása
 | 
			
		||||
            SetWorkbookProperties();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
 | 
			
		||||
        {
 | 
			
		||||
            DbParameters = dbParameters;
 | 
			
		||||
 | 
			
		||||
            dbParameters.TryGetValue("pElmeletgyakorlat", out string elmeletGyakorlat);
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(elmeletGyakorlat))
 | 
			
		||||
                elmeletGyakorlat = "0";
 | 
			
		||||
 | 
			
		||||
            dbParameters.TryGetValue("pErtekelestipusaId", out string ertekelesTipusaId);
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(ertekelesTipusaId))
 | 
			
		||||
                ertekelesTipusaId = Convert.ToString(Enums.ErtekelesTipusEnum.evvegi_jegy_ertekeles);
 | 
			
		||||
 | 
			
		||||
            // Adatforrás összeállítása
 | 
			
		||||
            SetExcelDataSet();
 | 
			
		||||
 | 
			
		||||
            DataTable tanuloDt = DataSet.Tables[0];
 | 
			
		||||
            DataTable tantargyakDt = DataSet.Tables[1];
 | 
			
		||||
            DataTable ertekelesDt = DataSet.Tables[2];
 | 
			
		||||
            DataTable magszorgDt = DataSet.Tables[3];
 | 
			
		||||
            DataTable mulasztasDt = DataSet.Tables[4];
 | 
			
		||||
            DataTable mulasztasSumDt = DataSet.Tables[5];
 | 
			
		||||
            DataTable szamossagDt = DataSet.Tables[6];
 | 
			
		||||
 | 
			
		||||
            if (osztalyFilterIds.Count > 0)
 | 
			
		||||
            {
 | 
			
		||||
                DataView tanuloDV = new DataView(tanuloDt);
 | 
			
		||||
                tanuloDV.RowFilter = string.Format("OSZTALYID IN ({0})", string.Join(", ", osztalyFilterIds.ToArray()));
 | 
			
		||||
                tanuloDt = tanuloDV.ToTable();
 | 
			
		||||
 | 
			
		||||
                var filteredTanuloIds = new List<string>();
 | 
			
		||||
                foreach (DataRow row in tanuloDt.Rows)
 | 
			
		||||
                {
 | 
			
		||||
                    filteredTanuloIds.Add($"'{(string)row["TANULOID"]}'");
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                var filteredIds = string.Join(", ", filteredTanuloIds.ToArray());
 | 
			
		||||
 | 
			
		||||
                DataView ertekelesDV = new DataView(ertekelesDt);
 | 
			
		||||
                ertekelesDV.RowFilter = $"TANULOID IN ({filteredIds})";
 | 
			
		||||
                ertekelesDt = ertekelesDV.ToTable();
 | 
			
		||||
 | 
			
		||||
                DataView magszorgDV = new DataView(magszorgDt);
 | 
			
		||||
                magszorgDV.RowFilter = $"TANULOID IN ({filteredIds})";
 | 
			
		||||
                magszorgDt = magszorgDV.ToTable();
 | 
			
		||||
 | 
			
		||||
                DataView mulasztasDV = new DataView(mulasztasDt);
 | 
			
		||||
                mulasztasDV.RowFilter = $"TANULOID IN ({filteredIds})";
 | 
			
		||||
                mulasztasDt = mulasztasDV.ToTable();
 | 
			
		||||
 | 
			
		||||
                DataView mulasztasSumDV = new DataView(mulasztasSumDt);
 | 
			
		||||
                mulasztasSumDV.RowFilter = $"TANULOID IN ({filteredIds})";
 | 
			
		||||
                mulasztasSumDt = mulasztasSumDV.ToTable();
 | 
			
		||||
 | 
			
		||||
                DataView szamossagDV = new DataView(szamossagDt);
 | 
			
		||||
                szamossagDV.RowFilter = $"TANULOID IN ({filteredIds})";
 | 
			
		||||
                szamossagDt = szamossagDV.ToTable();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //Munkalap összeállítása
 | 
			
		||||
            ExcelWorksheet worksheet = CreateSheet(Resources.ExcelNyomtatvanyResource.TanulokStatisztikaMunkalapnev, sheetIndex, eOrientation.Landscape, true);
 | 
			
		||||
            worksheet.Row(1).Height = 120;
 | 
			
		||||
            worksheet.Column(1).Width = 30;
 | 
			
		||||
            worksheet.Column(2).Width = 13;
 | 
			
		||||
            worksheet.Column(3).Width = 10;
 | 
			
		||||
            worksheet.Column(4).Width = 24;
 | 
			
		||||
            worksheet.View.FreezePanes(2, 5);
 | 
			
		||||
 | 
			
		||||
            for (int targycol = 5; targycol < tantargyakDt.Rows.Count + 4 + 3 + (elmeletGyakorlat.Equals("0") ? 8 : 14); targycol++)
 | 
			
		||||
                worksheet.Column(targycol).Width = 6;
 | 
			
		||||
 | 
			
		||||
            AddLabelCell(worksheet, 1, 1, Resources.ExcelNyomtatvanyResource.TanulokStatisztikaTanulok, HeaderStyleBottomBordered);
 | 
			
		||||
            AddLabelCell(worksheet, 1, 2, Resources.ExcelNyomtatvanyResource.TanulokStatisztikaOktAzon, HeaderStyleBottomBordered);
 | 
			
		||||
            AddLabelCell(worksheet, 1, 3, Resources.ExcelNyomtatvanyResource.TanulokStatisztikaOsztalyok, HeaderStyleBottomBordered);
 | 
			
		||||
            AddLabelCell(worksheet, 1, 4, Resources.ExcelNyomtatvanyResource.TanulokStatisztikaBesorolas, HeaderStyleBottomBordered);
 | 
			
		||||
            //AddLabelRange(worksheet, 1, 3, 1, 2/*Magatartás szorgalom*/ + tantargyakDt.Rows.Count + 1 + (elmeletGyakorlat.Equals("0") ? 8 : 14), osztalyDt.Rows[0]["C_NEV"].ToString(), DocheaderStyle2);
 | 
			
		||||
            //Értékelés statisztika hozzáadása
 | 
			
		||||
 | 
			
		||||
            int colOffset = 1;
 | 
			
		||||
            int[] retDimErtekeles;
 | 
			
		||||
            string[] adatMezo;
 | 
			
		||||
            string[] megjegyzesMezo;
 | 
			
		||||
 | 
			
		||||
            if (IsMagatartasSzorgalomNemLatszik)
 | 
			
		||||
            {
 | 
			
		||||
                adatMezo = new string[] { "ERTEKELES" };
 | 
			
		||||
                megjegyzesMezo = new string[] { "ERTEKELES_SZOVEG_MEGJEGYZES" };
 | 
			
		||||
                retDimErtekeles = AddDataTablePivotTable(worksheet, 1, colOffset, tantargyakDt, "TANTARGYID", "TANTARGY_NEV", tanuloDt, "TANULOID", new[] { "TANULONEV", "OKTATASIAZONOSITO", "OSZTALYNEV", "BESOROLASA" }, ertekelesDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, megjegyzesMezo, new[] { "AVERAGE", "IF,#3=0,#-1,1", null, null, "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanulmanyiAtlag, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanulmanyiAtlag2, null, null, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaBukasokSzama }, new[] { Numeric2BoldStyleBottomBordered, Numeric2BoldStyleBottomBordered, null, null, IntegerBoldStyleBottomBordered }, new[] { "AVERAGE", "COUNTIF,5", "COUNTIF,4", "COUNTIF,3", "COUNTIF,2", "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTantargyiAtlag, "5", "4", "3", "2", "1" }, new[] { Numeric2BoldStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered });
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                var magatartasHeaderDtCreatorArray = new List<string[]>
 | 
			
		||||
                    {
 | 
			
		||||
                        new[] { "id", "name", "torolt" },
 | 
			
		||||
                        new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaMagatartas, "F" }
 | 
			
		||||
                    };
 | 
			
		||||
                int[] retDimMag = AddDataTablePivotTable(worksheet, 1, colOffset, CreateDataTable(magatartasHeaderDtCreatorArray), new[] { "TOROLT" }, "name", tanuloDt, new[] { "TANULOID" }, new[] { "TANULONEV", "OKTATASIAZONOSITO", "OSZTALYNEV", "BESOROLASA" }, magszorgDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { "MagatartasOsztalyzat" }, null, null, null, null, new[] { "AVERAGE", "COUNTIF,5", "COUNTIF,4", "COUNTIF,3", "COUNTIF,2", "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTantargyiAtlag, "5", "4", "3", "2", "1" }, new[] { Numeric2BoldStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
                colOffset += retDimMag[1];
 | 
			
		||||
                var szorgalomHeaderDtCreatorArray = new List<string[]>
 | 
			
		||||
                    {
 | 
			
		||||
                        new[] { "id", "name", "torolt" },
 | 
			
		||||
                        new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaSzorgalom, "F" }
 | 
			
		||||
                    };
 | 
			
		||||
                int[] retDimSzorg = AddDataTablePivotTable(worksheet, 1, colOffset, CreateDataTable(szorgalomHeaderDtCreatorArray), new[] { "TOROLT" }, "name", tanuloDt, new[] { "TANULOID" }, null, magszorgDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { "SzorgalomOsztalyzat" }, null, null, null, null, new[] { "AVERAGE", "COUNTIF,5", "COUNTIF,4", "COUNTIF,3", "COUNTIF,2", "COUNTIF,1" }, null, new[] { Numeric2BoldStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
                colOffset += retDimSzorg[1];
 | 
			
		||||
 | 
			
		||||
                adatMezo = new string[] { "ERTEKELES" };
 | 
			
		||||
                megjegyzesMezo = new string[] { "ERTEKELES_SZOVEG_MEGJEGYZES" };
 | 
			
		||||
                retDimErtekeles = AddDataTablePivotTable(worksheet, 1, colOffset, tantargyakDt, "TANTARGYID", "TANTARGY_NEV", tanuloDt, "TANULOID", null, ertekelesDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, megjegyzesMezo, new[] { "AVERAGE", "IF,#3=0,#-1,1", null, null, "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanulmanyiAtlag, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTanulmanyiAtlag2, null, null, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaBukasokSzama }, new[] { Numeric2BoldStyleBottomBordered, Numeric2BoldStyleBottomBordered, null, null, IntegerBoldStyleBottomBordered }, new[] { "AVERAGE", "COUNTIF,5", "COUNTIF,4", "COUNTIF,3", "COUNTIF,2", "COUNTIF,1" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaTantargyiAtlag, "5", "4", "3", "2", "1" }, new[] { Numeric2BoldStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered, IntegerStyleBottomBordered });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            colOffset += retDimErtekeles[1];
 | 
			
		||||
            //Átlagok átlaga
 | 
			
		||||
            AddAggregateFormulaCell(worksheet, retDimErtekeles[0] - 5, colOffset - 5, "AVERAGE", 2, colOffset - 5, 1 + retDimErtekeles[0] - 7, colOffset - 5, true, Numeric2BoldBigerStyleBottomBordered);
 | 
			
		||||
            //Átlagok 2 átlaga
 | 
			
		||||
            AddAggregateFormulaCell(worksheet, retDimErtekeles[0] - 5, colOffset - 4, "AVERAGE", 2, colOffset - 4, 1 + retDimErtekeles[0] - 7, colOffset - 4, true, Numeric2BoldBigerStyleBottomBordered);
 | 
			
		||||
            //Bukások száma
 | 
			
		||||
            AddAggregateFormulaCell(worksheet, retDimErtekeles[0] - 5, colOffset - 1, "SUM", 2, colOffset - 1, 1 + retDimErtekeles[0] - 7, colOffset - 1, true, IntegerBoldStyleBottomBordered);
 | 
			
		||||
 | 
			
		||||
            //Dicséret, Kitűnő számosságok
 | 
			
		||||
            List<string> szamossagTipusok = new List<string> { "Dicseret", "Kituno" };
 | 
			
		||||
            List<string> szamossagTipusokNev = new List<string> { Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaDicseretekSzama, Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaKitunoErtekelesekSzama };
 | 
			
		||||
            int szamossagPos = 0;
 | 
			
		||||
            foreach (var szamossagTipus in szamossagTipusok)
 | 
			
		||||
            {
 | 
			
		||||
                var szamossag1DtCreatorArray = new List<string[]>
 | 
			
		||||
                {
 | 
			
		||||
                    new[] { "id", "name", "TOROLT"},
 | 
			
		||||
                    new[] { "1", szamossagTipusokNev[szamossagPos], "F" }
 | 
			
		||||
                };
 | 
			
		||||
                AddDataTablePivotTable(worksheet, 1, colOffset - 3 + szamossagPos, CreateDataTable(szamossag1DtCreatorArray), new string[0], "name",
 | 
			
		||||
                    tanuloDt, new[] { "TANULOID" }, null, szamossagDt, IntegerBoldStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, new[] { szamossagTipus }, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
                szamossagPos++;
 | 
			
		||||
            }
 | 
			
		||||
            int[] retDimSzamossag = new[] { retDimErtekeles[0], 2 };
 | 
			
		||||
 | 
			
		||||
            //Mulasztási statisztika hozzáadása
 | 
			
		||||
            List<string[]> hianyzasHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
            List<string[]> kesespercHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
            List<string[]> keseshianyzasHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
            List<string[]> feldolgozandokHeaderDtCreatorArray = new List<string[]>();
 | 
			
		||||
 | 
			
		||||
            List<string> hianyzaskesespercFilter = new List<string>(new[] { "tipus_char", "c_igazolt" });
 | 
			
		||||
            List<string> keseshianyzasFilter = new List<string>(new[] { "c_igazolt" });
 | 
			
		||||
 | 
			
		||||
            if (elmeletGyakorlat.Equals("0"))
 | 
			
		||||
            {
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazoltHianyzas, "H", "T" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazolatlanHianyzas, "H", "F" });
 | 
			
		||||
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazoltKesesPerc, "K", "T" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazolatlanKesesPerc, "K", "F" });
 | 
			
		||||
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "c_igazolt" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazoltKesesHianyzas, "T" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaIgazolatlanKesesHianyzas, "F" });
 | 
			
		||||
 | 
			
		||||
                feldolgozandokHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt" });
 | 
			
		||||
                feldolgozandokHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.FeldolgozatlanMulasztas, "H", "-" });
 | 
			
		||||
                feldolgozandokHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.FeldolgozatlanKesesPerc, "K", "-" });
 | 
			
		||||
            }
 | 
			
		||||
            else if (elmeletGyakorlat.Equals("1"))
 | 
			
		||||
            {
 | 
			
		||||
                hianyzaskesespercFilter.Add("c_gyakorlati");
 | 
			
		||||
                keseshianyzasFilter.Add("c_gyakorlati");
 | 
			
		||||
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt", "c_gyakorlati" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazoltHianyzas, "H", "T", "F" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazoltHianyzas, "H", "T", "T" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazolatlanHianyzas, "H", "F", "F" });
 | 
			
		||||
                hianyzasHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazolatlanHianyzas, "H", "F", "T" });
 | 
			
		||||
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt", "c_gyakorlati" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazoltKesesPerc, "K", "T", "F" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazoltKesesPerc, "K", "T", "T" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazolatlanKesesPerc, "K", "F", "F" });
 | 
			
		||||
                kesespercHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazolatlanKesesPerc, "K", "F", "T" });
 | 
			
		||||
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "c_igazolt", "c_gyakorlati" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazoltKesesHianyzas, "T", "F" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazoltKesesHianyzas, "T", "T" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaElmeletiIgazolatlanKesesHianyzas, "F", "F" });
 | 
			
		||||
                keseshianyzasHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.OsztalyStatisztikaGyakorlatiIgazolatlanKesesHianyzas, "F", "T" });
 | 
			
		||||
 | 
			
		||||
                feldolgozandokHeaderDtCreatorArray.Add(new[] { "id", "mulasztas_name", "tipus_char", "c_igazolt", "c_gyakorlati" });
 | 
			
		||||
                feldolgozandokHeaderDtCreatorArray.Add(new[] { "1", Resources.ExcelNyomtatvanyResource.FeldolgozatlanElmeletiMulasztas, "H", "-", "F" });
 | 
			
		||||
                feldolgozandokHeaderDtCreatorArray.Add(new[] { "2", Resources.ExcelNyomtatvanyResource.FeldolgozatlanGyakorlatiMulasztas, "H", "-", "T" });
 | 
			
		||||
                feldolgozandokHeaderDtCreatorArray.Add(new[] { "3", Resources.ExcelNyomtatvanyResource.FeldolgozatlanElmeletiKesesPerc, "K", "-", "F" });
 | 
			
		||||
                feldolgozandokHeaderDtCreatorArray.Add(new[] { "4", Resources.ExcelNyomtatvanyResource.FeldolgozatlanGyakorlatiKesesPerc, "K", "-", "T" });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            adatMezo = new[] { "MULASZTASOK_SZAMA" };
 | 
			
		||||
            int[] retDimHianyzas = AddDataTablePivotTable(worksheet, 1, colOffset, CreateDataTable(hianyzasHeaderDtCreatorArray), hianyzaskesespercFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "TANULOID" }, null, mulasztasDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            colOffset += retDimHianyzas[1];
 | 
			
		||||
            adatMezo = new[] { "KESESPERC" };
 | 
			
		||||
            int[] retDimKesesperc = AddDataTablePivotTable(worksheet, 1, colOffset, CreateDataTable(kesespercHeaderDtCreatorArray), hianyzaskesespercFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "TANULOID" }, null, mulasztasDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            colOffset += retDimKesesperc[1];
 | 
			
		||||
            adatMezo = new[] { "MULASZTASOK_SZAMA" };
 | 
			
		||||
            int[] retDimMulasztas = AddDataTablePivotTable(worksheet, 1, colOffset, CreateDataTable(keseshianyzasHeaderDtCreatorArray), keseshianyzasFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "TANULOID" }, null, mulasztasSumDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
 | 
			
		||||
            colOffset += retDimMulasztas[1];
 | 
			
		||||
            adatMezo = new[] { "FELDOLGOZATLANOK_SZAMA" };
 | 
			
		||||
            AddDataTablePivotTable(worksheet, 1, colOffset, CreateDataTable(feldolgozandokHeaderDtCreatorArray), hianyzaskesespercFilter.ToArray(), "mulasztas_name", tanuloDt, new[] { "TANULOID" }, null, mulasztasDt, IntegerStyleBottomBordered, HeaderStyle90BottomBordered, HeaderStyleBottomBordered, adatMezo, null, null, null, null, new[] { "SUM" }, null, new[] { IntegerBoldStyleBottomBordered });
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,18 @@
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Iktatas
 | 
			
		||||
{
 | 
			
		||||
    public class FoszamDefinicioModel
 | 
			
		||||
    {
 | 
			
		||||
        public Enums.DokumentumElemiSzintEnum Szint { get; set; }
 | 
			
		||||
        public bool IntezmenyId { get; set; }
 | 
			
		||||
        public bool TanevId { get; set; }
 | 
			
		||||
        public bool OsztalyId { get; set; }
 | 
			
		||||
        public bool CsoportId { get; set; }
 | 
			
		||||
        public bool TanarId { get; set; }
 | 
			
		||||
        public bool EvfolyamId { get; set; }
 | 
			
		||||
        public bool TeremId { get; set; }
 | 
			
		||||
        public bool GondviseloNeve { get; set; }
 | 
			
		||||
        public bool TanuloNeve { get; set; }
 | 
			
		||||
        public bool TanuloEgyediAzonosito { get; set; }
 | 
			
		||||
        public bool AlkalmazottEgyediAzonosito { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,18 @@
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Iktatas
 | 
			
		||||
{
 | 
			
		||||
    public class FoszamDefinicioValueModel
 | 
			
		||||
    {
 | 
			
		||||
        public Enums.DokumentumElemiSzintEnum Szint { get; set; }
 | 
			
		||||
        public int? IntezmenyId { get; set; }
 | 
			
		||||
        public int? TanevId { get; set; }
 | 
			
		||||
        public int? OsztalyId { get; set; }
 | 
			
		||||
        public int? CsoportId { get; set; }
 | 
			
		||||
        public int? TanarId { get; set; }
 | 
			
		||||
        public int? EvfolyamId { get; set; }
 | 
			
		||||
        public int? TeremId { get; set; }
 | 
			
		||||
        public string GondviseloNeve { get; set; }
 | 
			
		||||
        public string TanuloNeve { get; set; }
 | 
			
		||||
        public string TanuloEgyediAzonosito { get; set; }
 | 
			
		||||
        public string AlkalmazottEgyediAzonosito { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,12 @@
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Iktatas
 | 
			
		||||
{
 | 
			
		||||
    public class KulcsszoDefinicioModel
 | 
			
		||||
    {
 | 
			
		||||
        public Enums.DokumentumKulcsszoTipusEnum Type { get; set; }
 | 
			
		||||
        public bool Mandatory { get; set; }
 | 
			
		||||
        public bool Multiple { get; set; }
 | 
			
		||||
        public string TableName { get; set; }
 | 
			
		||||
        public string ColumnName { get; set; }
 | 
			
		||||
        public string AlternativeColumnName { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,211 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Collections.Specialized;
 | 
			
		||||
using System.Data;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using Kreta.BusinessLogic.Classes;
 | 
			
		||||
using Kreta.Core.ConnectionType;
 | 
			
		||||
using Kreta.DataAccessManual;
 | 
			
		||||
using Kreta.Enums;
 | 
			
		||||
using Kreta.Enums.ManualEnums;
 | 
			
		||||
 | 
			
		||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Iktatas
 | 
			
		||||
{
 | 
			
		||||
    public class KulcsszoHelper : LogicBase
 | 
			
		||||
    {
 | 
			
		||||
        public KulcsszoHelper(IConnectionType connectionType) : base(connectionType) { }
 | 
			
		||||
 | 
			
		||||
        public NameValueCollection GetKulcsszavak(Enums.DokumentumTipusEnum? dokumentumTipus, List<KulcsszoDefinicioModel> kulcsszoDefinicioModel, DataSet ds)
 | 
			
		||||
        {
 | 
			
		||||
            NameValueCollection kulcsSzavak = new NameValueCollection();
 | 
			
		||||
            foreach (var kulcsszo in kulcsszoDefinicioModel)
 | 
			
		||||
            {
 | 
			
		||||
                switch (kulcsszo.Type)
 | 
			
		||||
                {
 | 
			
		||||
                    case DokumentumKulcsszoTipusEnum.DokumentumTipus:
 | 
			
		||||
                        kulcsSzavak.Add(kulcsszo.Type.ToString(), (dokumentumTipus != null) ? dokumentumTipus.AsInt().ToString() : "Nem beazonosított dokumentum típus");
 | 
			
		||||
                        break;
 | 
			
		||||
                    case DokumentumKulcsszoTipusEnum.Csoportjellemzo:
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("CSJVegzosEvfolyamu_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["CSJVegzosEvfolyamu_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), CsoportJellemzoEnum.VegzosEvfolyamu.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJCSJKeresztfeleves_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJCSJKeresztfeleves_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), CsoportJellemzoEnum.Keresztfeleves.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJIsGyogypedagogiaiLogopediai_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJIsGyogypedagogiaiLogopediai_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), CsoportJellemzoEnum.IsGyogypedagogiaiLogopediai.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        break;
 | 
			
		||||
                    case DokumentumKulcsszoTipusEnum.Osztalyjellemzo:
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJCSJKeresztfeleves_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJCSJKeresztfeleves_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), OsztalyJellemzoEnum.Keresztfeleves.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJTechnikaiOsztaly_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJTechnikaiOsztaly_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), OsztalyJellemzoEnum.TechnikaiOsztaly.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJNemzetisegi_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJNemzetisegi_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), OsztalyJellemzoEnum.Nemzetisegi.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJKettannyelvu_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJKettannyelvu_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), OsztalyJellemzoEnum.Kettannyelvu.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJNyelviElokeszito_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJNyelviElokeszito_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), OsztalyJellemzoEnum.NyelviElokeszito.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJIsGyogypedagogiaiLogopediai_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJIsGyogypedagogiaiLogopediai_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), OsztalyJellemzoEnum.IsGyogypedagogiaiLogopediai.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJSportOsztaly_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJSportOsztaly_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), OsztalyJellemzoEnum.SportOsztaly.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains("OJAranyJanosProgram_BOOL") && ds.Tables[kulcsszo.TableName].Rows.Cast<DataRow>().Any(x => (bool)x["OJAranyJanosProgram_BOOL"]))
 | 
			
		||||
                        {
 | 
			
		||||
                            kulcsSzavak.Add(kulcsszo.Type.ToString(), OsztalyJellemzoEnum.AranyJanosProgram.AsInt().ToString());
 | 
			
		||||
                        }
 | 
			
		||||
                        break;
 | 
			
		||||
                    default:
 | 
			
		||||
                        if (kulcsszo.Multiple)
 | 
			
		||||
                        {
 | 
			
		||||
                            DataView view = ds.Tables[kulcsszo.TableName].DefaultView;
 | 
			
		||||
                            string[] columns = (kulcsszo.AlternativeColumnName != null) ? new string[2] { kulcsszo.ColumnName, kulcsszo.AlternativeColumnName } : new string[1] { kulcsszo.ColumnName };
 | 
			
		||||
                            DataTable distinctTable = view.ToTable(true, columns);
 | 
			
		||||
                            foreach (DataRow row in distinctTable.Rows)
 | 
			
		||||
                            {
 | 
			
		||||
                                if (!(row[kulcsszo.ColumnName] is DBNull))
 | 
			
		||||
                                {
 | 
			
		||||
                                    if (!(kulcsSzavak[kulcsszo.Type.ToString()] ?? "").Contains(row[kulcsszo.ColumnName].ToString()))
 | 
			
		||||
                                    {
 | 
			
		||||
                                        kulcsSzavak.Add(kulcsszo.Type.ToString(), row[kulcsszo.ColumnName].ToString());
 | 
			
		||||
                                    }
 | 
			
		||||
                                }
 | 
			
		||||
                                else if ((kulcsszo.AlternativeColumnName != null) && !(row[kulcsszo.AlternativeColumnName] is DBNull))
 | 
			
		||||
                                {
 | 
			
		||||
                                    string prefix;
 | 
			
		||||
                                    switch (kulcsszo.Type)
 | 
			
		||||
                                    {
 | 
			
		||||
                                        case DokumentumKulcsszoTipusEnum.TanuloEgyediAzonosito:
 | 
			
		||||
                                            prefix = "T";
 | 
			
		||||
                                            break;
 | 
			
		||||
                                        case DokumentumKulcsszoTipusEnum.AlkalmazottEgyediAzonosito:
 | 
			
		||||
                                            prefix = "A";
 | 
			
		||||
                                            break;
 | 
			
		||||
                                        default:
 | 
			
		||||
                                            prefix = "??";
 | 
			
		||||
                                            break;
 | 
			
		||||
                                    }
 | 
			
		||||
                                    var val = string.Format("{0}_{1}_{2}_{3}", prefix, IntezmenyId, TanevId, row[kulcsszo.AlternativeColumnName].ToString());
 | 
			
		||||
                                    if (!(kulcsSzavak[kulcsszo.Type.ToString()] ?? "").Contains(val))
 | 
			
		||||
                                    {
 | 
			
		||||
                                        kulcsSzavak.Add(kulcsszo.Type.ToString(), val);
 | 
			
		||||
                                    }
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
                            if (ds.Tables.Count > 0 && ds.Tables[kulcsszo.TableName] != null && ds.Tables[kulcsszo.TableName].Rows.Count > 0 && ds.Tables[kulcsszo.TableName].Columns.Contains(kulcsszo.ColumnName) && !(ds.Tables[kulcsszo.TableName].Rows[0][kulcsszo.ColumnName] is DBNull))
 | 
			
		||||
                            {
 | 
			
		||||
                                kulcsSzavak.Add(kulcsszo.Type.ToString(), ds.Tables[kulcsszo.TableName].Rows[0][kulcsszo.ColumnName].ToString());
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                        break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            return kulcsSzavak;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public FoszamDefinicioValueModel FillFoszamDefinicioErtekek(NameValueCollection kulcsszavak, FoszamDefinicioModel foszamDefinicio)
 | 
			
		||||
        {
 | 
			
		||||
            if (foszamDefinicio == null)
 | 
			
		||||
            {
 | 
			
		||||
                throw new ApplicationException("Hiányzó főszám definíció");
 | 
			
		||||
            }
 | 
			
		||||
            FoszamDefinicioValueModel valueModel = new FoszamDefinicioValueModel();
 | 
			
		||||
            valueModel.Szint = foszamDefinicio.Szint;
 | 
			
		||||
            if (foszamDefinicio.IntezmenyId)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.IntezmenyId = IntezmenyId;
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.TanevId)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.TanevId = TanevId;
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.OsztalyId)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.OsztalyId = int.Parse(kulcsszavak[DokumentumKulcsszoTipusEnum.OsztalyNev.ToString()]);
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.CsoportId)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.CsoportId = int.Parse(kulcsszavak[DokumentumKulcsszoTipusEnum.CsoportNev.ToString()]);
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.TanarId)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.TanarId = int.Parse(kulcsszavak[DokumentumKulcsszoTipusEnum.Alkalmazott.ToString()]);
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.EvfolyamId)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.EvfolyamId = int.Parse(kulcsszavak[DokumentumKulcsszoTipusEnum.Evfolyam.ToString()]);
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.TeremId)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.TeremId = int.Parse(kulcsszavak[DokumentumKulcsszoTipusEnum.Terem.ToString()]);
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.GondviseloNeve)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.GondviseloNeve = kulcsszavak[DokumentumKulcsszoTipusEnum.Gondviselo.ToString()];
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.TanuloNeve)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.TanuloNeve = kulcsszavak[DokumentumKulcsszoTipusEnum.Tanulo.ToString()];
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.AlkalmazottEgyediAzonosito)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.AlkalmazottEgyediAzonosito = kulcsszavak[DokumentumKulcsszoTipusEnum.AlkalmazottEgyediAzonosito.ToString()];
 | 
			
		||||
            }
 | 
			
		||||
            if (foszamDefinicio.TanuloEgyediAzonosito)
 | 
			
		||||
            {
 | 
			
		||||
                valueModel.TanuloEgyediAzonosito = kulcsszavak[DokumentumKulcsszoTipusEnum.TanuloEgyediAzonosito.ToString()];
 | 
			
		||||
            }
 | 
			
		||||
            return valueModel;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public List<Tuple<string, string>> GetKulcsszoTipusErtekParos(int iktatottDokumentumId)
 | 
			
		||||
        {
 | 
			
		||||
            return Dal.CustomConnection.Run(ConnectionType, (h) =>
 | 
			
		||||
            {
 | 
			
		||||
                var ret = new List<Tuple<string, string>>();
 | 
			
		||||
                var dal = h.NyomtatvanyokDal();
 | 
			
		||||
                DataSet ds = dal.GetKulcsszoertekekOnIktatottDokumentum(IntezmenyId, TanevId, iktatottDokumentumId);
 | 
			
		||||
 | 
			
		||||
                foreach (DataRow row in ds.Tables[0].Rows)
 | 
			
		||||
                {
 | 
			
		||||
                    if ((int)row["tipus"] == (int)DokumentumKulcsszoTipusEnum.Osztalyjellemzo)
 | 
			
		||||
                    {
 | 
			
		||||
                        row["ertek"] = int.Parse(row["ertek"].ToString()).GetDisplayName<OsztalyJellemzoEnum>(TanevId);
 | 
			
		||||
                    }
 | 
			
		||||
                    else if ((int)row["tipus"] == (int)DokumentumKulcsszoTipusEnum.Csoportjellemzo)
 | 
			
		||||
                    {
 | 
			
		||||
                        row["ertek"] = int.Parse(row["ertek"].ToString()).GetDisplayName<CsoportJellemzoEnum>(TanevId);
 | 
			
		||||
                    }
 | 
			
		||||
                    ret.Add(new Tuple<string, string>(row["tipus_DNAME"].ToString(), row["ertek"].ToString()));
 | 
			
		||||
                }
 | 
			
		||||
                /// TODO: Mert ha kilóg belőle, akkor az utolsó sor nem látszik.
 | 
			
		||||
                if (ret.Count > 13)
 | 
			
		||||
                {
 | 
			
		||||
                    ret.Add(new Tuple<string, string>("", ""));
 | 
			
		||||
                }
 | 
			
		||||
                return ret;
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user