public void AppendFrom(Report report, SemiRowsContainer semirowscontainer) { ShowStyle ss = HandleNoGroupHeader(report, ShowStyle.NoGroupHeader); SemiRows semirows = semirowscontainer.GetABlock(); AppendSemiRows(report, semirows, ss, null); }
public void AppendFrom(Report report, SemiRowsContainer semirowscontainer, ShowStyle showstyle) { SemiRows semirows = semirowscontainer.GetABlock(); showstyle = HandleNoGroupHeader(report, showstyle); AppendSemiRows(report, semirows, showstyle, null); }
private ShowStyle HandleNoGroupHeader(Report report, ShowStyle showstyle) { if (showstyle == ShowStyle.NoGroupHeader) { _nogroupheader = true; GroupSummary gs = report.Sections.GetGroupSummary(1); if (gs == null || gs.Cells.Count == 0) { _nogroupheader = false; showstyle = ShowStyle.Normal; } } return(showstyle); }
private void SetRowState(ShowStyle showstyle, Row row) { if (showstyle == ShowStyle.NoGroupSummary) { row.RowState = GroupHeaderRowStates.Expanded; } else if (showstyle == ShowStyle.Normal) { row.RowState = GroupHeaderRowStates.Normal; } else { row.RowState = GroupHeaderRowStates.Classical; } }
private void AppendFrom(Section section, SemiRow semirow, ShowStyle showstyle, string baseid, System.Drawing.Graphics g) { if (section == null || (_nogroupheader && section.Type == "GroupHeader")) { return; } foreach (SectionLine sl in section.SectionLines) { if (sl.Cells.Count > 0) { if (section is GroupHeader) { GroupHeaderRow row = new GroupHeaderRow(sl, semirow, g); SetRowState(showstyle, row); _parentrows.Add(row.Level.ToString(), row); if (row.Level > 1) { row.ParentRow = _parentrows[Convert.ToString(row.Level - 1)] as GroupHeaderRow; } Add(row); } else if (section is GroupSummary) { GroupRow row = new GroupRow(sl, semirow, g); SetRowState(showstyle, row); row.ParentRow = _parentrows[Convert.ToString(row.Level)] as GroupHeaderRow; Add(row); } else { Row row = new Row(sl, semirow, baseid, g); SetRowState(showstyle, row); row.ParentRow = _parentrows[Convert.ToString(row.Level - 1)] as GroupHeaderRow; Add(row); } } } }
public static extern bool ShowWindow(IntPtr hWnd, ShowStyle nCmdShow);
public void FillFrom(Report report) { if (_report != null) { _report.BaseTable = report.BaseTable; } _grouplevels = report.GroupLevels; if (!string.IsNullOrEmpty(report.BaseTable)) { _tablenamecollection.Add(report.BaseTable); if (!_levelcollection.Contains(report.BaseTable) || _grouplevels > (int)_levelcollection[report.BaseTable]) { _levelcollection.Add(report.BaseTable, _grouplevels); } } if (!string.IsNullOrEmpty(report.RawTable)) { _tablenamecollection.Add(report.RawTable); } if (!string.IsNullOrEmpty(report.CrossTable)) { _tablenamecollection.Add(report.CrossTable); } if (report.bFromCache) { if (report.bPageByGroup) { _pages = report.RowsCount == 0 ? 1 : report.RowsCount; } else { _pages = report.PageRecords == 0 ? 1 : (report.RowsCount / report.PageRecords + (report.RowsCount % report.PageRecords == 0 ? 0 : 1)); } _report.RowsCount = report.RowsCount; _report.GroupsCount = report.GroupsCount; return; } if (_report != null) { _report.Dispose(); _report = null; } _report = report; _type = _report.Type; if (string.IsNullOrEmpty(_viewid)) { _viewid = _report.ViewID; } if (!string.IsNullOrEmpty(_colorid)) { _report.ColorStyleID = _colorid; } if (_showstyle == ShowStyle.None) { if (!_report.bNoneCross && _report.CurrentCrossSchema != null) { if (_report.CurrentCrossSchema.CrossRowGroup != null) { _showstyle = _report.CurrentCrossSchema.CrossRowGroup.ShowStyle; } else { _showstyle = _report.CurrentCrossSchema.ShowStyle; //为了升级兼容 } } else { _showstyle = _report.CurrentSchema.ShowStyle; } } //自由报表合并单元格--2 //if (_type == ReportType.FreeReport) // _report.CurrentSchema.ShowStyle = (_report.FreeViewStyle == FreeViewStyle.MergeCell ? ShowStyle.NoGroupHeader : ShowStyle.Normal); _bshowdetail = report.bShowDetail; _pageindex = 0; if (_report.bPageByGroup) { _pages = _report.RowsCount == 0 ? 1 : _report.RowsCount; } else { _pages = _report.PageRecords == 0?1:(_report.RowsCount / _report.PageRecords + (_report.RowsCount % _report.PageRecords == 0 ? 0 : 1)); } if (_report.bIndicator) { return; } using (Graphics g = Row.CreateGraphics()) { _report.TransformFromInchOfHandredToPixel(g); } foreach (Section section in report.Sections) { section.Cells.SetSuper(); } #region RedrawReportHeader Section header = _report.Sections[SectionType.ReportHeader]; if (header != null) { foreach (Cell cell in header.Cells) { if (cell is Expression && cell.Visible) { if ((cell as Expression).Formula.FormulaExpression == "Page()" || (cell as Expression).Formula.FormulaExpression == "Pages()") { _dynamiccontentonheader = true; if (_report.ReportHeaderOption != ReportHeaderPrintOption.NotPint) { _report.ReportHeaderOption = ReportHeaderPrintOption.EveryPage; } } } } } #endregion }
public void AppendFromWait(Report report, SemiRowsContainer semirowscontainer, ShowStyle showstyle, System.Drawing.Graphics g) { SemiRows semirows = semirowscontainer.GetABlockWait(); showstyle = HandleNoGroupHeader(report, showstyle); AppendSemiRows(report, semirows, showstyle, g); //report.FreeViewStyle == FreeViewStyle.MergeCell ?ShowStyle.NoGroupHeader :ShowStyle.Normal }
public void AppendFrom(Report report, SemiRows semirows) { ShowStyle ss = HandleNoGroupHeader(report, ShowStyle.NoGroupHeader); AppendSemiRows(report, semirows, ss, null); }
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); } } }