PdfRpt.Core.Helper.TableHelper.AddDefaultEmptyDataSourceTable C# (CSharp) Method

AddDefaultEmptyDataSourceTable() public static method

It will be used for OnDataSourceIsEmptyEvent.
public static AddDefaultEmptyDataSourceTable ( Document pdfDoc, IPdfFont pdfRptFont, PdfRunDirection runDirection, string message = "There is no data available to display." ) : void
pdfDoc iTextSharp.text.Document Pdf document object
pdfRptFont IPdfFont fonts
runDirection PdfRunDirection A possible run direction value, left-to-right or right-to-left
message string a message to show
return void
        public static void AddDefaultEmptyDataSourceTable(Document pdfDoc, IPdfFont pdfRptFont, PdfRunDirection? runDirection, string message = "There is no data available to display.")
        {
            var table = SimpleTable(
                        columnsNumber: 1,
                        pdfCellAttributesList: new List<CellAttributes>
                        {
                            null,
                            new CellAttributes
                            {
                                RowData = new CellRowData
                                {
                                    Value = message
                                },
                                ItemTemplate = new TextBlockField(),
                                BasicProperties = new CellBasicProperties
                                {
                                    BackgroundColor = BaseColor.WHITE,
                                    HorizontalAlignment = HorizontalAlignment.Center,
                                    ShowBorder = false,
                                    RunDirection = runDirection.HasValue? runDirection.Value : PdfRunDirection.LeftToRight,
                                    PdfFont = pdfRptFont,
                                    FontColor = new BaseColor(Color.Black.ToArgb()),
                                }
                            },
                            null
                        },
                        showBorder: true
                );
            pdfDoc.Add(table);
        }