PdfRpt.Core.PdfTable.MainTableCellsEvent.printSummary C# (CSharp) Method

printSummary() private method

private printSummary ( Rectangle position, PdfContentByte canvases ) : void
position iTextSharp.text.Rectangle
canvases iTextSharp.text.pdf.PdfContentByte
return void
        private void printSummary(Rectangle position, PdfContentByte[] canvases)
        {
            var rowSummaryDataObj = getRowSummaryData() ?? string.Empty;

            var rowSummaryData = FuncHelper.ApplyFormula(_pdfRptCell.SharedData.PdfColumnAttributes.AggregateFunction.DisplayFormatFormula, rowSummaryDataObj);

            if (!_pdfRptCell.BasicProperties.RunDirection.HasValue)
                _pdfRptCell.BasicProperties.RunDirection = PdfRunDirection.LeftToRight;

            if (_pdfRptCell.BasicProperties.RunDirection == PdfRunDirection.RightToLeft)
                rowSummaryData = rowSummaryData.FixWeakCharacters();

            var formattedValue = rowSummaryData.ToSafeString();
            setCellData(rowSummaryDataObj, formattedValue);
            setMainTableEvents();

            var phrase = _pdfRptCell.BasicProperties.PdfFont.FontSelector.Process(_pdfRptCell.RowData.FormattedValue);
            var alignment = getAggregateValuePosition(position);
            ColumnText.ShowTextAligned(
                                    canvas: canvases[PdfPTable.TEXTCANVAS],
                                    alignment: (int)alignment.HorizontalAlignment,
                                    phrase: phrase,
                                    x: alignment.X,
                                    y: ((position.Bottom + position.Top) / 2) - 4,
                                    rotation: 0,
                                    runDirection: (int)_pdfRptCell.BasicProperties.RunDirection,
                                    arabicOptions: 0);
        }