Пример #1
0
 protected virtual IndicatorBuilder CreateIndicatorDetailBuilder(string viewid, IndicatorDetail idetail, Detail detail, SemiRowsContainer semirowcontainer)
 {
     return(new IndicatorDetailBuilder(viewid, idetail, detail, _semirowscontainer));
 }
Пример #2
0
        protected override void _semirowscontainer_ReportComing(Report report)
        {
            if (_detailbuilder == null)
            {
                IndicatorDetail indicatordetail = (IndicatorDetail)report.Sections[SectionType.IndicatorDetail];
                if (_context.MatrixOrChart == MatrixOrChart.None)
                {
                    if (indicatordetail.Cells.Count == 2)
                    {
                        Cell cell1 = indicatordetail.Cells[0];
                        Cell cell2 = indicatordetail.Cells[1];
                        if ((cell1.Visible && !cell2.Visible) || (!cell1.Visible && cell2.Visible))
                        {
                            if (cell1 is IndicatorMetrix && cell2 is Chart)
                            {
                                if (cell1.Visible)
                                {
                                    _context.MatrixOrChart = MatrixOrChart.Matrix;
                                    indicatordetail.Cells.Remove(cell2);
                                }
                                else
                                {
                                    _context.MatrixOrChart = MatrixOrChart.Chart;
                                }
                            }
                            else if (cell1 is Chart && cell2 is IndicatorMetrix)
                            {
                                if (cell1.Visible)
                                {
                                    _context.MatrixOrChart = MatrixOrChart.Chart;
                                }
                                else
                                {
                                    _context.MatrixOrChart = MatrixOrChart.Matrix;
                                    indicatordetail.Cells.Remove(cell1);
                                }
                            }
                        }
                    }
                }
                else if (_context.MatrixOrChart == MatrixOrChart.Chart)
                {
                    Cell cell1 = indicatordetail.Cells[0];
                    Cell cell2 = indicatordetail.Cells[1];
                    if (cell1 is IndicatorMetrix)
                    {
                        cell1.Visible = false;
                        cell2.Visible = true;
                    }
                    else
                    {
                        cell1.Visible = true;
                        cell2.Visible = false;
                    }
                }
                else//MatrixOrChart.Matrix
                {
                    Cell cell1 = indicatordetail.Cells[0];
                    Cell cell2 = indicatordetail.Cells[1];
                    if (cell1 is IndicatorMetrix)
                    {
                        cell1.Visible = true;
                        indicatordetail.Cells.Remove(cell2);
                    }
                    else
                    {
                        cell2.Visible = true;
                        indicatordetail.Cells.Remove(cell1);
                    }
                }

                //if (indicatordetail.Cells.Count == 1 && indicatordetail.Cells[0] is IndicatorMetrix)
                //{
                //    _detailbuilder = CreateIndicatorBuilder(report.ViewID, indicatordetail.Cells[0] as IndicatorMetrix, _semirowscontainer4matrix);
                //}
                //else
                //{
                Detail detail = new Detail();
                report.Sections.Remove(indicatordetail);
                report.Sections.Add(detail);
                _detailbuilder = CreateIndicatorDetailBuilder(report.ViewID, indicatordetail, detail, _semirowscontainer);
                _context.FillFrom(report);
                //}
            }
            else
            {
                OnBindingMatrixStyle(report);

                //if (_semirowscontainer4matrix.b4Matrix )
                //{
                //    report.Type = ReportType.MetrixReport;
                //    report.FreeViewStyle = FreeViewStyle.MergeCell;
                //    _context.FillFrom(report);
                //    _context.ViewID = _detailbuilder.ViewID;
                //    report.SetVisibleWidth(report.Sections[SectionType.PageTitle].VisibleWidth);
                //    //_detailbuilder.BuildIndicatorMetrix(report, false);
                //}
                _context.Report.BaseTable = report.BaseTable;

                bool hasdrilldefined = OnDrillDefined(_context.ViewID, report.ViewID);
                _detailbuilder.BuildIndicatorMetrix(report, hasdrilldefined);
            }
        }
Пример #3
0
        private void AppendSemiRows(Report report, SemiRows semirows, ShowStyle showstyle, System.Drawing.Graphics g)
        {
            if (semirows != null)
            {
                Sections sections    = report.Sections;
                Detail   detail      = sections[SectionType.Detail] as Detail;
                int      grouplevels = report.GroupLevels;
                foreach (SemiRow semirow in semirows)
                {
                    Section section  = null;
                    Section section1 = null;
                    switch (semirow.SectionType)
                    {
                    case SectionType.GroupHeader:
                        section = sections.GetGroupHeader(semirow.Level);
                        if ((!report.bShowDetail || detail.Cells.Count == 0) && semirow.Level == grouplevels)    //detail.Cells.Count == 0
                        {
                            ApplyDetailStyle(section, _minordetailcount, detail, (detail as IAlternativeStyle).bApplyAlternative);
                            _minordetailcount++;
                        }
                        else
                        {
                            _minordetailcount = 0;
                            //if (showstyle == ShowStyle.NoGroupHeader)
                            //    ApplyDetailStyle(section, 0, detail, false);
                        }
                        break;

                    case SectionType.GroupSummary:
                        section = sections.GetGroupSummary(semirow.Level);
                        if ((!report.bShowDetail || detail.Cells.Count == 0) && semirow.Level == grouplevels)
                        {
                            _minordetailcount++;
                            ApplyDetailStyle(section, _minordetailcount, detail, (detail as IAlternativeStyle).bApplyAlternative);
                            _minordetailcount++;
                        }
                        else
                        {
                            _minordetailcount = 0;
                            //if (showstyle == ShowStyle.NoGroupHeader)
                            //    ApplyDetailStyleToGroupLabel(section, detail);
                        }
                        break;

                    case SectionType.ReportSummary:
                        section = sections[SectionType.ReportSummary];
                        break;

                    default:
                        if (report.bShowDetail)
                        {
                            section = detail;
                            (section as IAlternativeStyle).bApplySecondStyle = (_minordetailcount % 2 == 1);
                        }
                        else
                        {
                            section = sections.GetGroupHeader(semirow.Level);
                            ApplyDetailStyle(section, _minordetailcount, detail, (detail as IAlternativeStyle).bApplyAlternative);
                            section1 = sections.GetGroupSummary(semirow.Level);
                            ApplyDetailStyle(section1, _minordetailcount, detail, (detail as IAlternativeStyle).bApplyAlternative);
                        }
                        _minordetailcount++;
                        break;
                    }
                    AppendFrom(section, semirow, showstyle, report.BaseID, g);
                    AppendFrom(section1, semirow, showstyle, report.BaseID, g);
                }
            }
        }
Пример #4
0
        protected override Section AddALoacleSection(XmlElement xec)
        {
            Section section = null;
            string  type    = xec.GetAttribute("Type");

            switch (type.ToLower())
            {
            case "pageheader":
                section = new PageHeader();
                AddOtherControl(xec, section);
                break;

            case "pagefooter":
                section = new PageFooter();
                AddOtherControl(xec, section);
                break;

            case "pagetitle":
                section = new PageTitle();
                AddCalculateControl(xec, section);
                break;

            case "printpagetitle":
                section = new PrintPageTitle();
                AddOtherControl(xec, section);
                break;

            case "printpagesummary":
                section = new PrintPageSummary();
                AddOtherControl(xec, section);
                break;

            case "reportheader":
                section = new ReportHeader();
                AddHeaderControl(xec, section);
                break;

            case "reportsummary":
                section = new ReportSummary();
                AddCalculateControl(xec, section);
                (section as ReportSummary).InitVisibleWidth();
                break;

            case "groupheader":
                section = new GroupHeader();
                AddGroupControl(xec, section);
                break;

            case "groupsummary":
                section = new GroupSummary();
                AddGroupSummaryControl(xec, section);
                break;

            case "detail":
                section = new Detail();
                AddNormalControl(xec, section);
                break;
            }
            if (section != null)
            {
                ConvertFromLocaleInfo(xec, section);
                //section.Name = "";
                _report.Sections.Add(section);
            }
            return(section);
        }
        public IndicatorDetailBuilder(string viewid, IndicatorDetail indicatordetail, Detail detail, SemiRowsContainer semirowscontainer)
        {
            _viewid = viewid;
            indicatordetail.AsignToSectionLines();
            _currentcells = indicatordetail.Cells;
            _currentlines = indicatordetail.SectionLines;

            _detail            = detail;
            _detail.UnderState = ReportStates.Browse;
            _semirowscontainer = semirowscontainer;
            _rows = new Rows();

            for (int i = 0; i < _currentlines.Count; i++)
            {
                _newline = new SectionLine(_detail);
                _detail.SectionLines.Add(_newline);
            }

            _data = new DataSet();
        }