/// <summary> /// Constructor /// </summary> /// <param name="report">report document</param> /// <param name="data">report data</param> /// <exception cref="ArgumentException">Flow document must have a specified page height</exception> /// <exception cref="ArgumentException">Flow document must have a specified page width</exception> /// <exception cref="ArgumentException">Flow document can have only one report header section</exception> /// <exception cref="ArgumentException">Flow document can have only one report footer section</exception> public ReportPaginator(ReportDocument report, ReportData data) { _report = report; _data = data; _flowDocument = report.CreateFlowDocument(); _pageSize = new Size(_flowDocument.PageWidth, _flowDocument.PageHeight); if (_flowDocument.PageHeight == double.NaN) throw new ArgumentException("Flow document must have a specified page height"); if (_flowDocument.PageWidth == double.NaN) throw new ArgumentException("Flow document must have a specified page width"); _dynamicCache = new ReportPaginatorDynamicCache(_flowDocument); ArrayList listPageHeaders = _dynamicCache.GetFlowDocumentVisualListByType(typeof(SectionReportHeader)); if (listPageHeaders.Count > 1) throw new ArgumentException("Flow document can have only one report header section"); if (listPageHeaders.Count == 1) _blockPageHeader = (SectionReportHeader)listPageHeaders[0]; ArrayList listPageFooters = _dynamicCache.GetFlowDocumentVisualListByType(typeof(SectionReportFooter)); if (listPageFooters.Count > 1) throw new ArgumentException("Flow document can have only one report footer section"); if (listPageFooters.Count == 1) _blockPageFooter = (SectionReportFooter)listPageFooters[0]; _paginator = ((IDocumentPaginatorSource)_flowDocument).DocumentPaginator; // remove header and footer in our working copy Block block = _flowDocument.Blocks.FirstBlock; while (block != null) { Block thisBlock = block; block = block.NextBlock; if ((thisBlock == _blockPageHeader) || (thisBlock == _blockPageFooter)) _flowDocument.Blocks.Remove(thisBlock); } // get report context values _reportContextValues = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IInlineContextValue)); FillData(); }
// ReSharper restore InconsistentNaming /// <summary> /// Constructor /// </summary> /// <param name="report">report document</param> /// <param name="data">report data</param> /// <exception cref="ArgumentException">Flow document must have a specified page height</exception> /// <exception cref="ArgumentException">Flow document must have a specified page width</exception> /// <exception cref="ArgumentException">Flow document can have only one report header section</exception> /// <exception cref="ArgumentException">Flow document can have only one report footer section</exception> public ReportPaginator(ReportDocument report, ReportData data) { _report = report; _data = data; _flowDocument = report.CreateFlowDocument(); _pageSize = new Size(_flowDocument.PageWidth, _flowDocument.PageHeight); if (_flowDocument.PageHeight == double.NaN) { throw new ArgumentException("Flow document must have a specified page height"); } if (_flowDocument.PageWidth == double.NaN) { throw new ArgumentException("Flow document must have a specified page width"); } _dynamicCache = new ReportPaginatorDynamicCache(_flowDocument); ArrayList listPageHeaders = _dynamicCache.GetFlowDocumentVisualListByType(typeof(SectionReportHeader)); if (listPageHeaders.Count > 1) { throw new ArgumentException("Flow document can have only one report header section"); } if (listPageHeaders.Count == 1) { _blockPageHeader = (SectionReportHeader)listPageHeaders[0]; } ArrayList listPageFooters = _dynamicCache.GetFlowDocumentVisualListByType(typeof(SectionReportFooter)); if (listPageFooters.Count > 1) { throw new ArgumentException("Flow document can have only one report footer section"); } if (listPageFooters.Count == 1) { _blockPageFooter = (SectionReportFooter)listPageFooters[0]; } _paginator = ((IDocumentPaginatorSource)_flowDocument).DocumentPaginator; // remove header and footer in our working copy Block block = _flowDocument.Blocks.FirstBlock; while (block != null) { Block thisBlock = block; block = block.NextBlock; if ((thisBlock == _blockPageHeader) || (thisBlock == _blockPageFooter)) { _flowDocument.Blocks.Remove(thisBlock); } } // get report context values _reportContextValues = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IInlineContextValue)); FillData(); }
// ReSharper restore InconsistentNaming /// <summary> /// Constructor /// </summary> /// <param name="report">report document</param> /// <param name="data">report data</param> /// <exception cref="ArgumentException">Flow document must have a specified page height</exception> /// <exception cref="ArgumentException">Flow document must have a specified page width</exception> /// <exception cref="ArgumentException">Flow document can have only one report header section</exception> /// <exception cref="ArgumentException">Flow document can have only one report footer section</exception> public ReportPaginator(ReportDocument report, ReportData data, Action<int, int> PageGeneratedCallBack = null, FlowDocument flowDocument = null) { _report = report; _data = data; _pageGeneratedCallBack = PageGeneratedCallBack; _flowDocument = flowDocument; if (_flowDocument == null) _flowDocument = report.CreateFlowDocument(); _pageSize = new Size(_flowDocument.PageWidth, _flowDocument.PageHeight); if (_flowDocument.PageHeight == double.NaN) throw new ArgumentException("Flow document must have a specified page height"); if (_flowDocument.PageWidth == double.NaN) throw new ArgumentException("Flow document must have a specified page width"); _dynamicCache = new ReportPaginatorDynamicCache(_flowDocument); ArrayList listPageHeaders = _dynamicCache.GetFlowDocumentVisualListByType(typeof(SectionReportHeader)); if (listPageHeaders.Count > 1) throw new ArgumentException("Flow document can have only one report header section"); if (listPageHeaders.Count == 1) _blockPageHeader = (SectionReportHeader)listPageHeaders[0]; ArrayList listPageFooters = _dynamicCache.GetFlowDocumentVisualListByType(typeof(SectionReportFooter)); if (listPageFooters.Count > 1) throw new ArgumentException("Flow document can have only one report footer section"); if (listPageFooters.Count == 1) _blockPageFooter = (SectionReportFooter)listPageFooters[0]; _paginator = ((IDocumentPaginatorSource)_flowDocument).DocumentPaginator; // remove header and footer in our working copy Block block = _flowDocument.Blocks.FirstBlock; while (block != null) { Block thisBlock = block; block = block.NextBlock; if ((thisBlock == _blockPageHeader) || (thisBlock == _blockPageFooter)) _flowDocument.Blocks.Remove(thisBlock); } // get report context values _reportContextValues = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IInlineContextValue)); FillData(); /*Application.Current.Dispatcher.Invoke(new Action(() => { Window aa = new Window(); FlowDocumentPageViewer bb = new FlowDocumentPageViewer(); bb.Document = _flowDocument; aa.Content = bb; aa.SizeToContent = SizeToContent.WidthAndHeight; aa.ShowDialog(); }));*/ }
// ReSharper restore InconsistentNaming /// <summary> /// Constructor /// </summary> /// <param name="report">report document</param> /// <param name="data">report data</param> /// <exception cref="ArgumentException">Flow document must have a specified page height</exception> /// <exception cref="ArgumentException">Flow document must have a specified page width</exception> /// <exception cref="ArgumentException">Flow document can have only one report header section</exception> /// <exception cref="ArgumentException">Flow document can have only one report footer section</exception> public ReportPaginator(ReportDocument report, ReportData data, Action <int, int> PageGeneratedCallBack = null, FlowDocument flowDocument = null) { _report = report; _data = data; _pageGeneratedCallBack = PageGeneratedCallBack; _flowDocument = flowDocument; if (_flowDocument == null) { _flowDocument = report.CreateFlowDocument(); } _pageSize = new Size(_flowDocument.PageWidth, _flowDocument.PageHeight); if (_flowDocument.PageHeight == double.NaN) { throw new ArgumentException("Flow document must have a specified page height"); } if (_flowDocument.PageWidth == double.NaN) { throw new ArgumentException("Flow document must have a specified page width"); } _dynamicCache = new ReportPaginatorDynamicCache(_flowDocument); ArrayList listPageHeaders = _dynamicCache.GetFlowDocumentVisualListByType(typeof(SectionReportHeader)); if (listPageHeaders.Count > 1) { throw new ArgumentException("Flow document can have only one report header section"); } if (listPageHeaders.Count == 1) { _blockPageHeader = (SectionReportHeader)listPageHeaders[0]; } ArrayList listPageFooters = _dynamicCache.GetFlowDocumentVisualListByType(typeof(SectionReportFooter)); if (listPageFooters.Count > 1) { throw new ArgumentException("Flow document can have only one report footer section"); } if (listPageFooters.Count == 1) { _blockPageFooter = (SectionReportFooter)listPageFooters[0]; } _paginator = ((IDocumentPaginatorSource)_flowDocument).DocumentPaginator; // remove header and footer in our working copy Block block = _flowDocument.Blocks.FirstBlock; while (block != null) { Block thisBlock = block; block = block.NextBlock; if ((thisBlock == _blockPageHeader) || (thisBlock == _blockPageFooter)) { _flowDocument.Blocks.Remove(thisBlock); } } // get report context values _reportContextValues = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IInlineContextValue)); FillData(); /*Application.Current.Dispatcher.Invoke(new Action(() => * { * Window aa = new Window(); * FlowDocumentPageViewer bb = new FlowDocumentPageViewer(); * bb.Document = _flowDocument; * aa.Content = bb; * aa.SizeToContent = SizeToContent.WidthAndHeight; * aa.ShowDialog(); * }));*/ }
/// <summary> /// Fills document with data /// </summary> /// <exception cref="InvalidDataException">ReportTableRow must have a TableRowGroup as parent</exception> protected virtual void FillData() { ArrayList blockDocumentValues = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IInlineDocumentValue)); // walker.Walk<IInlineDocumentValue>(_flowDocument); ArrayList blockTableRows = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(ITableRowForDataTable)); // walker.Walk<TableRowForDataTable>(_flowDocument); ArrayList blockAggregateValues = _dynamicCache.GetFlowDocumentVisualListByType(typeof(InlineAggregateValue)); // walker.Walk<InlineAggregateValue>(_flowDocument); ArrayList charts = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IChart)); // walker.Walk<IChart>(_flowDocument); ArrayList dynamicHeaderTableRows = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(ITableRowForDynamicHeader)); ArrayList dynamicDataTableRows = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(ITableRowForDynamicDataTable)); ArrayList documentConditions = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IDocumentCondition)); List <Block> blocks = new List <Block>(); if (_blockPageHeader != null) { blocks.Add(_blockPageHeader); } if (_blockPageFooter != null) { blocks.Add(_blockPageFooter); } DocumentWalker walker = new DocumentWalker(); blockDocumentValues.AddRange(walker.TraverseBlockCollection <IInlineDocumentValue>(blocks)); Dictionary <string, List <object> > aggregateValues = new Dictionary <string, List <object> >(); FillCharts(charts); // hide conditional text blocks foreach (IDocumentCondition dc in documentConditions) { if (dc == null) { continue; } dc.PerformRenderUpdate(_data); } // fill report values foreach (IInlineDocumentValue dv in blockDocumentValues) { if (dv == null) { continue; } object obj; if ((dv.PropertyName != null) && (_data.ReportDocumentValues.TryGetValue(dv.PropertyName, out obj))) { dv.Value = obj; RememberAggregateValue(aggregateValues, dv.AggregateGroup, obj); } else { if ((_data.ShowUnknownValues) && (dv.Value == null)) { dv.Value = "[" + ((dv.PropertyName != null) ? dv.PropertyName : "NULL") + "]"; } RememberAggregateValue(aggregateValues, dv.AggregateGroup, null); } } // fill dynamic tables foreach (ITableRowForDynamicDataTable iTableRow in dynamicDataTableRows) { TableRow tableRow = iTableRow as TableRow; if (tableRow == null) { continue; } TableRowGroup tableGroup = tableRow.Parent as TableRowGroup; if (tableGroup == null) { continue; } TableRow currentRow; DataTable table = _data.GetDataTableByName(iTableRow.TableName); for (int i = 0; i < table.Rows.Count; i++) { currentRow = new TableRow(); DataRow dataRow = table.Rows[i]; for (int j = 0; j < table.Columns.Count; j++) { string value = dataRow[j].ToString(); currentRow.Cells.Add(new TableCell(new Paragraph(new Run(value)))); } tableGroup.Rows.Add(currentRow); } } foreach (ITableRowForDynamicHeader iTableRow in dynamicHeaderTableRows) { TableRow tableRow = iTableRow as TableRow; if (tableRow == null) { continue; } DataTable table = _data.GetDataTableByName(iTableRow.TableName); foreach (DataRow row in table.Rows) { string value = row[0].ToString(); TableCell tableCell = new TableCell(new Paragraph(new Run(value))); tableRow.Cells.Add(tableCell); } } // group table row groups Dictionary <TableRowGroup, List <TableRow> > groupedRows = new Dictionary <TableRowGroup, List <TableRow> >(); Dictionary <TableRowGroup, string> tableNames = new Dictionary <TableRowGroup, string>(); foreach (TableRow tableRow in blockTableRows) { TableRowGroup rowGroup = tableRow.Parent as TableRowGroup; if (rowGroup == null) { continue; } ITableRowForDataTable iTableRow = tableRow as ITableRowForDataTable; if ((iTableRow != null) && (iTableRow.TableName != null)) { string tableName; if (tableNames.TryGetValue(rowGroup, out tableName)) { if (tableName != iTableRow.TableName.Trim().ToLowerInvariant()) { throw new ReportingException("TableRowGroup cannot be mapped to different DataTables in TableRowForDataTable"); } } else { tableNames[rowGroup] = iTableRow.TableName.Trim().ToLowerInvariant(); } } List <TableRow> rows; if (!groupedRows.TryGetValue(rowGroup, out rows)) { rows = new List <TableRow>(); groupedRows[rowGroup] = rows; } rows.Add(tableRow); } // fill tables foreach (KeyValuePair <TableRowGroup, List <TableRow> > groupedRow in groupedRows) { TableRowGroup rowGroup = groupedRow.Key; ITableRowForDataTable iTableRow = groupedRow.Value[0] as ITableRowForDataTable; if (iTableRow == null) { continue; } DataTable table = _data.GetDataTableByName(iTableRow.TableName); if (table == null) { if (_data.ShowUnknownValues) { // show unknown values foreach (TableRow tableRow in groupedRow.Value) { foreach (TableCell cell in tableRow.Cells) { DocumentWalker localWalker = new DocumentWalker(); List <ITableCellValue> tableCells = localWalker.TraverseBlockCollection <ITableCellValue>(cell.Blocks); foreach (ITableCellValue cv in tableCells) { IPropertyValue dv = cv as IPropertyValue; if (dv == null) { continue; } dv.Value = "[" + dv.PropertyName + "]"; RememberAggregateValue(aggregateValues, cv.AggregateGroup, null); } } } } else { continue; } } else { List <TableRow> listNewRows = new List <TableRow>(); TableRow newTableRow; // clone XAML rows List <string> clonedRows = new List <string>(); foreach (TableRow row in rowGroup.Rows) { TableRowForDataTable reportTableRow = row as TableRowForDataTable; if (reportTableRow == null) { clonedRows.Add(null); } clonedRows.Add(XamlWriter.Save(reportTableRow)); } for (int i = 0; i < table.Rows.Count; i++) { DataRow dataRow = table.Rows[i]; for (int j = 0; j < rowGroup.Rows.Count; j++) { TableRow row = rowGroup.Rows[j]; TableRowForDataTable reportTableRow = row as TableRowForDataTable; if (reportTableRow == null) { // clone regular row listNewRows.Add(XamlHelper.CloneTableRow(row)); } else { // clone ReportTableRows newTableRow = (TableRow)XamlHelper.LoadXamlFromString(clonedRows[j]); foreach (TableCell cell in newTableRow.Cells) { DocumentWalker localWalker = new DocumentWalker(); List <ITableCellValue> newCells = localWalker.TraverseBlockCollection <ITableCellValue>(cell.Blocks); foreach (ITableCellValue cv in newCells) { IPropertyValue dv = cv as IPropertyValue; if (dv == null) { continue; } try { object obj = dataRow[dv.PropertyName]; if (obj == DBNull.Value) { obj = null; } dv.Value = obj; RememberAggregateValue(aggregateValues, cv.AggregateGroup, obj); } catch { if (_data.ShowUnknownValues) { dv.Value = "[" + dv.PropertyName + "]"; } else { dv.Value = ""; } RememberAggregateValue(aggregateValues, cv.AggregateGroup, null); } } } listNewRows.Add(newTableRow); // fire event _report.FireEventDataRowBoundEventArgs(new DataRowBoundEventArgs(_report, dataRow) { TableName = dataRow.Table.TableName, TableRow = newTableRow }); } } } rowGroup.Rows.Clear(); foreach (TableRow row in listNewRows) { rowGroup.Rows.Add(row); } } } // fill aggregate values foreach (InlineAggregateValue av in blockAggregateValues) { if (String.IsNullOrEmpty(av.AggregateGroup)) { continue; } string[] aggregateGroups = av.AggregateGroup.Split(new char[] { ',', ';', ' ' }, StringSplitOptions.RemoveEmptyEntries); foreach (var group in aggregateGroups) { if (!aggregateValues.ContainsKey(group)) { av.Text = av.EmptyValue; break; } } av.Text = av.ComputeAndFormat(aggregateValues); } }
/// <summary> /// Fills document with data /// </summary> /// <exception cref="InvalidDataException">ReportTableRow must have a TableRowGroup as parent</exception> protected virtual void FillData() { ArrayList blockDocumentValues = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IInlineDocumentValue)); // walker.Walk<IInlineDocumentValue>(_flowDocument); ArrayList blockTableRows = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(ITableRowForDataTable)); // walker.Walk<TableRowForDataTable>(_flowDocument); ArrayList blockAggregateValues = _dynamicCache.GetFlowDocumentVisualListByType(typeof(InlineAggregateValue)); // walker.Walk<InlineAggregateValue>(_flowDocument); ArrayList charts = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(IChart)); // walker.Walk<IChart>(_flowDocument); ArrayList dynamicHeaderTableRows = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(ITableRowForDynamicHeader)); ArrayList dynamicDataTableRows = _dynamicCache.GetFlowDocumentVisualListByInterface(typeof(ITableRowForDynamicDataTable)); List <Block> blocks = new List <Block>(); if (_blockPageHeader != null) { blocks.Add(_blockPageHeader); } if (_blockPageFooter != null) { blocks.Add(_blockPageFooter); } DocumentWalker walker = new DocumentWalker(); blockDocumentValues.AddRange(walker.TraverseBlockCollection <IInlineDocumentValue>(blocks)); Dictionary <string, List <object> > aggregateValues = new Dictionary <string, List <object> >(); FillCharts(charts); // fill report values foreach (IInlineDocumentValue dv in blockDocumentValues) { if (dv == null) { continue; } object obj = null; if ((dv.PropertyName != null) && (_data.ReportDocumentValues.TryGetValue(dv.PropertyName, out obj))) { dv.Value = obj; RememberAggregateValue(aggregateValues, dv.AggregateGroup, obj); } else { if ((_data.ShowUnknownValues) && (dv.Value == null)) { dv.Value = "[" + ((dv.PropertyName != null) ? dv.PropertyName : "NULL") + "]"; } RememberAggregateValue(aggregateValues, dv.AggregateGroup, null); } } // fill dynamic tables foreach (ITableRowForDynamicDataTable iTableRow in dynamicDataTableRows) { TableRow tableRow = iTableRow as TableRow; if (tableRow == null) { continue; } TableRowGroup tableGroup = tableRow.Parent as TableRowGroup; if (tableGroup == null) { continue; } TableRow currentRow = null; DataTable table = _data.GetDataTableByName(iTableRow.TableName); for (int i = 0; i < table.Rows.Count; i++) { currentRow = new TableRow(); DataRow dataRow = table.Rows[i]; for (int j = 0; j < table.Columns.Count; j++) { string value = dataRow[j].ToString(); currentRow.Cells.Add(new TableCell(new Paragraph(new Run(value)))); } tableGroup.Rows.Add(currentRow); } } foreach (ITableRowForDynamicHeader iTableRow in dynamicHeaderTableRows) { TableRow tableRow = iTableRow as TableRow; if (tableRow == null) { continue; } DataTable table = _data.GetDataTableByName(iTableRow.TableName); foreach (DataRow row in table.Rows) { string value = row[0].ToString(); TableCell tableCell = new TableCell(new Paragraph(new Run(value))); tableRow.Cells.Add(tableCell); } } // fill tables foreach (ITableRowForDataTable iTableRow in blockTableRows) { TableRow tableRow = iTableRow as TableRow; if (tableRow == null) { continue; } DataTable table = _data.GetDataTableByName(iTableRow.TableName); if (table == null) { if (_data.ShowUnknownValues) { // show unknown values foreach (TableCell cell in tableRow.Cells) { DocumentWalker localWalker = new DocumentWalker(); List <ITableCellValue> tableCells = localWalker.TraverseBlockCollection <ITableCellValue>(cell.Blocks); foreach (ITableCellValue cv in tableCells) { IPropertyValue dv = cv as IPropertyValue; if (dv == null) { continue; } dv.Value = "[" + dv.PropertyName + "]"; IAggregateValue av = cv as IAggregateValue; if (av != null) { RememberAggregateValue(aggregateValues, av.AggregateGroup, null); } } } } else { continue; } } else { List <ITableCellValue> tableCells = new List <ITableCellValue>(); foreach (TableCell cell in tableRow.Cells) { DocumentWalker localWalker = new DocumentWalker(); tableCells.AddRange(localWalker.TraverseBlockCollection <ITableCellValue>(cell.Blocks)); } TableRowGroup rowGroup = tableRow.Parent as TableRowGroup; if (rowGroup == null) { throw new InvalidDataException("ReportTableRow must have a TableRowGroup as parent"); } List <TableRow> listNewRows = new List <TableRow>(); foreach (TableRow row in rowGroup.Rows) { TableRowForDataTable reportTableRow = row as TableRowForDataTable; if (reportTableRow == null) { // clone regular row listNewRows.Add(XamlHelper.CloneTableRow(row)); } else { string reportTableRowXaml = XamlWriter.Save(reportTableRow); // clone ReportTableRows List <TableRow> clonedTableRows = new List <TableRow>(); for (int i = 0; i < table.Rows.Count; i++) { clonedTableRows.Add((TableRow)XamlHelper.LoadXamlFromString(reportTableRowXaml)); } foreach (DataRow dataRow in table.Rows) { // get cloned ReportTableRow TableRow newTableRow = clonedTableRows[0]; clonedTableRows.RemoveAt(0); foreach (TableCell cell in newTableRow.Cells) { DocumentWalker localWalker = new DocumentWalker(); List <ITableCellValue> newCells = localWalker.TraverseBlockCollection <ITableCellValue>(cell.Blocks); foreach (ITableCellValue cv in newCells) { IPropertyValue dv = cv as IPropertyValue; if (dv == null) { continue; } IAggregateValue av = cv as IAggregateValue; try { object obj = dataRow[dv.PropertyName]; if (obj == DBNull.Value) { obj = null; } dv.Value = obj; if (av != null) { RememberAggregateValue(aggregateValues, av.AggregateGroup, obj); } } catch { if (_data.ShowUnknownValues) { dv.Value = "[" + dv.PropertyName + "]"; } else { dv.Value = ""; } if (av != null) { RememberAggregateValue(aggregateValues, av.AggregateGroup, null); } } } } listNewRows.Add(newTableRow); // fire event _report.FireEventDataRowBoundEventArgs(new DataRowBoundEventArgs(_report, dataRow) { TableName = dataRow.Table.TableName, TableRow = newTableRow }); } } } rowGroup.Rows.Clear(); foreach (TableRow row in listNewRows) { rowGroup.Rows.Add(row); } } } // fill aggregate values foreach (InlineAggregateValue av in blockAggregateValues) { if (String.IsNullOrEmpty(av.AggregateGroup)) { continue; } if (!aggregateValues.ContainsKey(av.AggregateGroup)) { av.Text = av.EmptyValue; } else { av.Text = av.ComputeAndFormat(aggregateValues); } } }