Esempio n. 1
0
        private void InitStyleValue()
        {
            string styleId = this.GetRequestParam("styleid");

            _facade = new ReportViewFacade(this.DataProvider);
            RptViewReportStyleDetail[] styleDtls = _facade.GetRptViewReportStyleDetailByStyleID(decimal.Parse(styleId));
            if (styleDtls == null || styleDtls.Length == 0)
            {
                return;
            }
            for (int i = 0; i < styleDtls.Length; i++)
            {
                if (styleDtls[i].StyleType == ReportStyleType.Header)
                {
                    RptViewDataFormat format = (RptViewDataFormat)_facade.GetRptViewDataFormat(styleDtls[i].FormatID);
                    if (format != null)
                    {
                        this.hidHeaderRow.Value = _facade.BuildStyleValueFromDataFormat(format);
                        this.hidHeader_0.Value  = this.hidHeaderRow.Value;
                        this.hidHeader_1.Value  = this.hidHeaderRow.Value;
                        this.hidHeader_2.Value  = this.hidHeaderRow.Value;
                    }
                }
                else if (styleDtls[i].StyleType == ReportStyleType.SubTotal)
                {
                    RptViewDataFormat format = (RptViewDataFormat)_facade.GetRptViewDataFormat(styleDtls[i].FormatID);
                    if (format != null)
                    {
                        this.hidGroup_0.Value       = _facade.BuildStyleValueFromDataFormat(format);
                        this.hidGroupData_0_0.Value = this.hidGroup_0.Value;
                        this.hidGroupData_0_1.Value = this.hidGroup_0.Value;
                        this.hidGroupData_0_2.Value = this.hidGroup_0.Value;
                    }
                }
                else if (styleDtls[i].StyleType == ReportStyleType.Item)
                {
                    RptViewDataFormat format = (RptViewDataFormat)_facade.GetRptViewDataFormat(styleDtls[i].FormatID);
                    if (format != null)
                    {
                        this.hidItemHeader.Value = _facade.BuildStyleValueFromDataFormat(format);
                        this.hidItemData_0.Value = this.hidItemHeader.Value;
                        this.hidItemData_1.Value = this.hidItemHeader.Value;
                        this.hidItemData_2.Value = this.hidItemHeader.Value;
                    }
                }
            }
            for (int i = 0; i < styleDtls.Length; i++)
            {
                if (styleDtls[i].StyleType == ReportStyleType.SubTotalGroupField)
                {
                    RptViewDataFormat format = (RptViewDataFormat)_facade.GetRptViewDataFormat(styleDtls[i].FormatID);
                    if (format != null)
                    {
                        this.hidGroupData_0_0.Value = _facade.BuildStyleValueFromDataFormat(format);
                    }
                }
                else if (styleDtls[i].StyleType == ReportStyleType.SubTotalNonCalField)
                {
                    RptViewDataFormat format = (RptViewDataFormat)_facade.GetRptViewDataFormat(styleDtls[i].FormatID);
                    if (format != null)
                    {
                        this.hidGroupData_0_1.Value = _facade.BuildStyleValueFromDataFormat(format);
                    }
                }
                else if (styleDtls[i].StyleType == ReportStyleType.SubTotalCalField)
                {
                    RptViewDataFormat format = (RptViewDataFormat)_facade.GetRptViewDataFormat(styleDtls[i].FormatID);
                    if (format != null)
                    {
                        this.hidGroupData_0_2.Value = _facade.BuildStyleValueFromDataFormat(format);
                    }
                }
            }
        }