PdfRpt.ColumnsItemsTemplates.AnnotationField.RenderingCell C# (CSharp) Méthode

RenderingCell() public méthode

Custom cell's content template as a PdfPCell
public RenderingCell ( PdfRpt.Core.Contracts.CellAttributes attributes ) : PdfPCell
attributes PdfRpt.Core.Contracts.CellAttributes
Résultat iTextSharp.text.pdf.PdfPCell
        public PdfPCell RenderingCell(CellAttributes attributes)
        {
            if (OnPrintAnnotation == null)
                throw new InvalidOperationException("Please set the OnPrintAnnotation formula.");

            var data = OnPrintAnnotation.Invoke(attributes.RowData.TableRowData);
            if (data == null) return new PdfPCell();

            var defaultFont = attributes.BasicProperties.PdfFont.Fonts[0];
            var chunk = new Chunk(".", defaultFont);
            chunk.SetAnnotation(
                    PdfAnnotation.CreateText(
                           attributes.SharedData.PdfWriter,
                           new Rectangle(100, 100),
                           data.Title,
                           data.Text,
                           false,
                           _annotationIcon[data.Icon]));

            return new PdfPCell(new Phrase(chunk));
        }