Ejemplo n.º 1
0
        private string thisPageSummary()
        {
            var pageBoundary = CurrentRowInfoData.PagesBoundaries.OrderByDescending(x => x).Take(2).ToList();

            if (!pageBoundary.Any())
            {
                return(string.Empty);
            }

            int firstRowOfThePage, lastRowOfThePage;

            if (pageBoundary.Count == 1)
            {
                firstRowOfThePage = 1;
                lastRowOfThePage  = pageBoundary[0];
            }
            else
            {
                firstRowOfThePage = pageBoundary[1] + 1;
                lastRowOfThePage  = pageBoundary[0];
            }

            var propertyName = _pdfRptCell.SharedData.PdfColumnAttributes.PropertyName;
            var list         = SummaryCellsData.Where(x => x.CellData.PropertyName == propertyName &&
                                                      x.OverallRowNumber >= firstRowOfThePage && x.OverallRowNumber <= lastRowOfThePage)
                               .ToList();
            var result = _pdfRptCell.SharedData.PdfColumnAttributes.AggregateFunction.ProcessingBoundary(list);

            return(FuncHelper.ApplyFormula(_pdfRptCell.SharedData.PdfColumnAttributes.AggregateFunction.DisplayFormatFormula, result));
        }
Ejemplo n.º 2
0
        private string getTotalSummaries()
        {
            var row          = CurrentRowInfoData.LastRenderedRowNumber;
            var propertyName = _pdfRptCell.SharedData.PdfColumnAttributes.PropertyName;

            var result = SummaryCellsData.FirstOrDefault(x => x.CellData.PropertyName == propertyName &&
                                                         x.OverallRowNumber == row);

            if (result == null)
            {
                return(string.Empty);
            }

            object data;

            if (IsGroupingEnabled &&
                (_pdfRptCell.RowData.PdfRowType == RowType.SummaryRow ||
                 _pdfRptCell.RowData.PdfRowType == RowType.PreviousPageSummaryRow))
            {
                data = result.GroupAggregateValue;
            }
            else
            {
                data = result.OverallAggregateValue;
            }

            return(FuncHelper.ApplyFormula(_pdfRptCell.SharedData.PdfColumnAttributes.AggregateFunction.DisplayFormatFormula, data));
        }