Ejemplo n.º 1
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);
                }
            }
        }