예제 #1
0
        protected override void DisplayDesignData()
        {
            if (this.designView.ChartMains != null && this.designView.ChartMains.Length > 0)
            {
                this.hidChartType.Value    = this.designView.ChartMains[0].ChartType;
                this.hidChartSubType.Value = this.designView.ChartMains[0].ChartSubType;
            }
            if (this.designView.ChartSeries != null)
            {
                string strVal = "";
                for (int i = 0; i < this.designView.ChartSeries.Length; i++)
                {
                    System.Web.UI.WebControls.ListItem item = this.lstUnSelectedSeries.Items.FindByValue(this.designView.ChartSeries[i].ColumnName);
                    if (item == null)
                    {
                        continue;
                    }
                    this.lstSelectedSeries.Items.Add(new System.Web.UI.WebControls.ListItem(item.Text, item.Value));
                    strVal += item.Value + ";";
                    this.lstUnSelectedSeries.Items.Remove(item);
                }
                this.hidSelectedSeriesValue.Value = strVal;
            }
            if (this.designView.ChartCategories != null)
            {
                string strVal = "";
                for (int i = 0; i < this.designView.ChartCategories.Length; i++)
                {
                    System.Web.UI.WebControls.ListItem item = this.lstUnSelectedCategory.Items.FindByValue(this.designView.ChartCategories[i].ColumnName);
                    if (item == null)
                    {
                        continue;
                    }
                    this.lstSelectedCategory.Items.Add(new System.Web.UI.WebControls.ListItem(item.Text, item.Value));
                    strVal += item.Value + ";";
                    this.lstUnSelectedCategory.Items.Remove(item);
                }
                this.hidSelectedCategoryValue.Value = strVal;
            }
            if (this.designView.ChartDatas != null)
            {
                for (int i = 0; i < this.designView.ChartDatas.Length; i++)
                {
                    System.Web.UI.WebControls.ListItem item = this.lstUnSelectColumn.Items.FindByValue(this.designView.ChartDatas[i].ColumnName);
                    if (item == null)
                    {
                        continue;
                    }
                    DataRow row = DtSource.NewRow();
                    row["GUID"]        = Guid.NewGuid().ToString();
                    row["Sequence"]    = this.designView.ChartDatas[i].DataSequence;
                    row["ColumnName"]  = item.Value;
                    row["DisplayDesc"] = this.designView.ChartDatas[i].Description;
                    row["TotalType"]   = this.designView.ChartDatas[i].TotalType;
                    this.DtSource.Rows.Add(row);
                    this.gridWebGrid.DataSource = DtSource;
                    this.gridWebGrid.DataBind();

                    this.lstUnSelectColumn.Items.Remove(item);
                }
            }
            if (this.designView.ChartMains != null)
            {
                this.chkIsShowLegend.Checked = FormatHelper.StringToBoolean(this.designView.ChartMains[0].ShowLegend);
                this.chkIsShowMarker.Checked = FormatHelper.StringToBoolean(this.designView.ChartMains[0].ShowMarker);
                if (this.chkIsShowMarker.Checked == true)
                {
                    this.rdoListMarkerType.SelectedValue = this.designView.ChartMains[0].MarkerType;
                }
                this.chkIsShowLabel.Checked = FormatHelper.StringToBoolean(this.designView.ChartMains[0].ShowLabel);
                if (this.chkIsShowLabel.Checked == true)
                {
                    string            strFormatId = this.designView.ChartMains[0].LabelFormatID;
                    ReportViewFacade  rptFacade   = new ReportViewFacade(this.DataProvider);
                    RptViewDataFormat dataFormat  = (RptViewDataFormat)rptFacade.GetRptViewDataFormat(strFormatId);
                    string            strVal      = "";
                    if (dataFormat != null)
                    {
                        strVal += dataFormat.FontFamily + ";";
                        strVal += dataFormat.FontSize.ToString() + ";";
                        strVal += (dataFormat.FontWeight == "Bold" ? "true" : "false") + ";";
                        strVal += (dataFormat.FontStyle == "Italic" ? "true" : "false") + ";";
                        strVal += (dataFormat.TextDecoration == "Underline" ? "true" : "false") + ";";
                        strVal += dataFormat.Color + ";";
                        strVal += dataFormat.BackgroundColor + ";";
                        if (dataFormat.TextAlign == "Center")
                        {
                            strVal += BenQGuru.eMES.Web.Helper.TextAlign.Center + ";";
                        }
                        else if (dataFormat.TextAlign == "Right")
                        {
                            strVal += BenQGuru.eMES.Web.Helper.TextAlign.Right + ";";
                        }
                        else
                        {
                            strVal += BenQGuru.eMES.Web.Helper.TextAlign.Left + ";";
                        }
                        if (dataFormat.VerticalAlign == "Top")
                        {
                            strVal += BenQGuru.eMES.Web.Helper.VerticalAlign.Top + ";";
                        }
                        else if (dataFormat.VerticalAlign == "Bottom")
                        {
                            strVal += BenQGuru.eMES.Web.Helper.VerticalAlign.Bottom + ";";
                        }
                        else
                        {
                            strVal += BenQGuru.eMES.Web.Helper.VerticalAlign.Middle + ";";
                        }
                        strVal += dataFormat.TextFormat;
                    }
                    this.hidLabelFormat.Value = strVal;
                }
            }
        }
예제 #2
0
        private void ApplyDefinedStyle(decimal styleId)
        {
            ReportViewFacade facade = new ReportViewFacade(this.DataProvider);

            RptViewReportStyleDetail[] styleDtls = facade.GetRptViewReportStyleDetailByStyleID(styleId);
            if (styleDtls == null || styleDtls.Length == 0)
            {
                ClearExistStyle();
                return;
            }
            for (int i = 1; i < this.tbFormat.Rows.Count; i++)
            {
                for (int n = 0; n < this.tbFormat.Rows[i].Cells.Count; n++)
                {
                    HtmlInputHidden hidVal = this.GetFormatInputField(this.tbFormat.Rows[i].Cells[n]);
                    if (hidVal == null)
                    {
                        continue;
                    }
                    string strFormatType = hidVal.Attributes["FormatType"];
                    string strStyleType  = "";
                    if (strFormatType == "header" || strFormatType == "headerrow")
                    {
                        strStyleType = ReportStyleType.Header;
                    }
                    else if (strFormatType == "group")
                    {
                        strStyleType = ReportStyleType.SubTotal;
                    }
                    else if (strFormatType == "groupdata")
                    {
                        strStyleType = "";
                        for (int j = 0; this.designView.GridGroups != null && j < this.designView.GridGroups.Length; j++)
                        {
                            if (this.designView.GridGroups[j].ColumnName == hidVal.Attributes["ColumnName"])
                            {
                                strStyleType = ReportStyleType.SubTotalGroupField;
                                break;
                            }
                        }
                        if (strStyleType == "")
                        {
                            for (int j = 0; this.designView.GridGroupTotals != null && j < this.designView.GridGroupTotals.Length; j++)
                            {
                                if (this.designView.GridGroupTotals[j].GroupSequence == decimal.Parse(hidVal.Attributes["GroupSeq"]) &&
                                    this.designView.GridGroupTotals[j].ColumnName == hidVal.Attributes["ColumnName"])
                                {
                                    if (this.designView.GridGroupTotals[j].TotalType == ReportTotalType.Empty)
                                    {
                                        strStyleType = ReportStyleType.SubTotalNonCalField;
                                    }
                                    else
                                    {
                                        strStyleType = ReportStyleType.SubTotalCalField;
                                    }
                                }
                            }
                        }
                    }
                    else if (strFormatType == "itemdata" || strFormatType == "item")
                    {
                        strStyleType = ReportStyleType.Item;
                    }

                    hidVal.Value = "";
                    RptViewReportStyleDetail styleDtl = this.GetRptStyleDetailByType(styleDtls, strStyleType);
                    if (styleDtl != null)
                    {
                        RptViewDataFormat dataFormat = (RptViewDataFormat)facade.GetRptViewDataFormat(styleDtl.FormatID);
                        if (dataFormat != null)
                        {
                            hidVal.Value = facade.BuildStyleValueFromDataFormat(dataFormat);
                        }
                    }
                }
            }
        }