protected void Page_Init(object sender, EventArgs e)
        {
            if (Session[Constant.SESSION_LOGGEDUSER] == null)
            {
                Response.Redirect(Constant.URL_LOGIN, false);
                return;
            }

            if (Session["CurrentReport"] != null)
            {
                Diary.Entity.ReportEntity reportEntity = new Diary.Entity.ReportEntity();
                reportEntity = (Diary.Entity.ReportEntity)Session["CurrentReport"];
                gvReports.DataSource = reportEntity.ReportData;
                gvReports.DataBind();
                cbmExporter.Visible = true;

                if (reportEntity.ReportType == Diary.Common.Enum.ReportTypes.CaseInfo.ToString())
                {

                    //GridViewDataDateColumn col = gvReports.Columns["TaskDate"] as GridViewDataDateColumn;
                    //col.PropertiesDateEdit.DisplayFormatString = "dd-MMM-yy";

                    DevExpress.Web.ASPxGridView.ASPxSummaryItem totalHours = new DevExpress.Web.ASPxGridView.ASPxSummaryItem();
                    totalHours.FieldName = "TotalHours";
                    totalHours.ShowInColumn = "TotalHours";
                    totalHours.SummaryType = SummaryItemType.Sum;
                    totalHours.DisplayFormat = "Total {0}";
                    totalHours.ShowInGroupFooterColumn = "TotalHours";
                    gvReports.TotalSummary.Add(totalHours);

                    DevExpress.Web.ASPxGridView.ASPxSummaryItem totalHoursGroup = new DevExpress.Web.ASPxGridView.ASPxSummaryItem();
                    totalHoursGroup.FieldName = "TotalHours";
                    totalHoursGroup.SummaryType = SummaryItemType.Sum;
                    totalHoursGroup.DisplayFormat = "Total {0}";

                    gvReports.GroupSummary.Add(totalHoursGroup);

                }

            }
            else
            {
                cbmExporter.Visible = false;
            }
        }
Exemplo n.º 2
0
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Session[Constant.SESSION_LOGGEDUSER] == null)
            {
                Response.Redirect(Constant.URL_LOGIN, false);
                return;
            }

            if (Session["CurrentReport"] != null)
            {
                Diary.Entity.ReportEntity reportEntity = new Diary.Entity.ReportEntity();
                reportEntity         = (Diary.Entity.ReportEntity)Session["CurrentReport"];
                gvReports.DataSource = reportEntity.ReportData;
                gvReports.DataBind();
                cbmExporter.Visible = true;

                if (reportEntity.ReportType == Diary.Common.Enum.ReportTypes.CaseInfo.ToString())
                {
                    //GridViewDataDateColumn col = gvReports.Columns["TaskDate"] as GridViewDataDateColumn;
                    //col.PropertiesDateEdit.DisplayFormatString = "dd-MMM-yy";

                    DevExpress.Web.ASPxGridView.ASPxSummaryItem totalHours = new DevExpress.Web.ASPxGridView.ASPxSummaryItem();
                    totalHours.FieldName               = "TotalHours";
                    totalHours.ShowInColumn            = "TotalHours";
                    totalHours.SummaryType             = SummaryItemType.Sum;
                    totalHours.DisplayFormat           = "Total {0}";
                    totalHours.ShowInGroupFooterColumn = "TotalHours";
                    gvReports.TotalSummary.Add(totalHours);


                    DevExpress.Web.ASPxGridView.ASPxSummaryItem totalHoursGroup = new DevExpress.Web.ASPxGridView.ASPxSummaryItem();
                    totalHoursGroup.FieldName     = "TotalHours";
                    totalHoursGroup.SummaryType   = SummaryItemType.Sum;
                    totalHoursGroup.DisplayFormat = "Total {0}";

                    gvReports.GroupSummary.Add(totalHoursGroup);
                }
            }
            else
            {
                cbmExporter.Visible = false;
            }
        }