        public ActionResult GetTotalStaffInfoByQualification()
        {
            double pageWidth = 0;
            double columnWidth = 0;
            DataHelper dataHelper = new DataHelper();
            StiReport report = new StiReport();
            ReportingDB reportingDB = new ReportingDB();
            SchoolInformation schoolInfo = new SchoolInformationDB().GetBasicSchoolInformation();
            schoolInfo.Logo = "http://" + Request.Url.Host.ToLower() + ":" + Request.Url.Port.ToString() + schoolInfo.Logo.TrimStart('~');// "http://localhost:56214/images/logo.jpg";
            schoolInfo.TodaysDateTime = DateTime.Now.ToString("dd-MMM-yyyy hh:mm tt");
            report.Load(Server.MapPath("~/Content/Reports/ReportTemplates/ReportPotrait.mrt"));
            report.RegBusinessObject("SchoolInfoModel", schoolInfo);
            StiComponent sc = report.GetComponentByName("txtReportName");
            StiText txtReportName = (StiText)report.GetComponentByName("txtReportName");
            report.ReportName = "Total Staff By Qualification";
            StiTable table;
            StiPage page = report.Pages[0];
            txtReportName.Text = "Total Staff By Qualification";
            DataTable tblDR = dataHelper.ExcuteStoredProcedureWithParameter(new List<System.Data.SqlClient.SqlParameter>(), "Hr_Stp_GetEmployeeCountByQualification");
            DataTable tempTable = new DataTable();
            string tableName = "Table";
            string tempColumnName = "tempColumn";
            int tableCount = (tblDR.Columns.Count / 6) + ((tblDR.Columns.Count % 6) > 0 ? 1 : 0);
            int totalColumn = tblDR.Columns.Count;
            int columnNumber = 6;
            int columnCount = 0;
            int remainingColumn = tblDR.Columns.Count;
            int iterateColumn = 0;
            bool leftBorder = true;
            List<object> paramsObj = new List<object>();
            if (tblDR.Columns.Count >= columnNumber)
            {
                columnWidth = page.Width / columnNumber;
            }
            else
            {
                columnWidth = page.Width / tblDR.Columns.Count;
                iterateColumn = remainingColumn;
            }
            for (int i = 1; i <= tableCount; i++)
            {
                tempTable = new DataTable();
                paramsObj = new List<object>();
                leftBorder = true;
                tempTable.TableName = tableName + i;
                if (iterateColumn < remainingColumn)
                {
                    iterateColumn = columnNumber;
                    remainingColumn = remainingColumn - columnNumber;
                }
                else
                {
                    iterateColumn = remainingColumn;
                }
                for (int j = 1; j <= iterateColumn; j++)
                {
                    tempTable.Columns.Add(tblDR.Columns[columnCount].ToString(), typeof(string));
                    paramsObj.Add(tblDR.Rows[0][columnCount].ToString());
                    columnCount++;
                }
                if (iterateColumn != 6 && iterateColumn < 6 && tableCount > 1)
                {
                    for (int tempColumnAdd = 1; tempColumnAdd <= (6 - iterateColumn); tempColumnAdd++)
                    {
                        tempTable.Columns.Add(tempColumnName + tempColumnAdd, typeof(string));
                        paramsObj.Add("");
                    }
                }
                tempTable.Rows.Add(paramsObj.ToArray());
                report.RegData(tempTable);
                report.Dictionary.Synchronize();
                table = new StiTable();
                table.Name = "StimulesTable" + i;
                pageWidth = page.Width;
                table.ColumnCount = tempTable.Columns.Count;
                table.RowCount = 3;
                table.HeaderRowsCount = 1;
                table.FooterRowsCount = 1;
                table.Width = page.Width;
                table.GrowToHeight = true;
                table.CanShrink = false;
                table.CanGrow = true;
                table.HeaderCanGrow = true;
                table.HeaderCanShrink = false;
                table.DataSourceName = String.Format("{0}", tempTable.TableName);
                page.Components.Add(table);
                table.CreateCell();
                int indexHeaderCell = 0;
                int indexDataCell = tempTable.Columns.Count;

                foreach (DataColumn column in tempTable.Columns)
                {
                    //Set text on header 
                    StiTableCell headerCell = table.Components[indexHeaderCell] as StiTableCell;
                    headerCell.Text.Value = column.Caption;
                    headerCell.Font = new System.Drawing.Font("Arial", 10f, FontStyle.Bold);
                    headerCell.HorAlignment = StiTextHorAlignment.Center;
                    headerCell.VertAlignment = StiVertAlignment.Center;
                    headerCell.Border.Side = StiBorderSides.All;
                    headerCell.Border.Style = StiPenStyle.Solid;
                    headerCell.Border.Color = System.Drawing.Color.Black;
                    //headerCell.Margins = new StiMargins(3, 3, 3, 3);

                    headerCell.Height = 1;
                    headerCell.WordWrap = true;
                    headerCell.CanGrow = true;
                    headerCell.CanShrink = false;
                    headerCell.GrowToHeight = true;

                    StiTableCell dataCell = table.Components[indexDataCell] as StiTableCell;
                    string sDataCellExpresion = String.Format("{{{0}.{1}}}", tempTable.TableName, Stimulsoft.Report.CodeDom.StiCodeDomSerializator.ReplaceSymbols(column.ColumnName));
                    dataCell.Text.Value = sDataCellExpresion;
                    dataCell.HorAlignment = StiTextHorAlignment.Center;
                    dataCell.VertAlignment = StiVertAlignment.Center;
                    dataCell.Border.Side = StiBorderSides.All;
                    dataCell.Font = new System.Drawing.Font("Arial", 8);
                    //dataCell.Margins = new StiMargins(3, 3, 3, 3);
                    dataCell.WordWrap = true;
                    dataCell.CanGrow = true;
                    dataCell.CanShrink = false;
                    dataCell.GrowToHeight = true;
                    dataCell.Border.Style = StiPenStyle.Solid;
                    dataCell.Border.Color = System.Drawing.Color.Black;
                    dataCell.Height = 1;
                    if (iterateColumn != 6 && iterateColumn < 6)
                    {
                        if ((indexHeaderCell + 1) > (6 - (6 - iterateColumn)))
                        {
                            headerCell.Text.Value = "";
                            headerCell.Border.Side = StiBorderSides.None;
                            dataCell.Border.Side = StiBorderSides.None;
                            if (leftBorder)
                            {
                                headerCell.Border.Side = StiBorderSides.Left;
                                dataCell.Border.Side = StiBorderSides.Left;
                            }
                            leftBorder = false;
                        }
                    }
                    indexHeaderCell++;
                    indexDataCell++;
                }

            }
            return StiMvcViewer.GetReportSnapshotResult(report);
        }
