C# Class PdfRpt.Core.Helper.TableHelper

PdfGrid helper class
Mostrar archivo Open project: VahidN/PdfReport

Public Methods

Method Description
AddBorderToTable ( this table ) : PdfGrid

Adds a border to an existing PdfGrid

AddBorderToTable ( this table, BaseColor borderColor, float spacingBefore ) : PdfGrid

Adds a border to an existing PdfGrid

AddDefaultEmptyDataSourceTable ( Document pdfDoc, IPdfFont pdfRptFont, PdfRunDirection runDirection, string message = "There is no data available to display." ) : void

It will be used for OnDataSourceIsEmptyEvent.

AddSimpleRow ( this table ) : void

Adds a new row to the specified table. The default IColumnItemsTemplate would be TextBlockField.

AddSummaryRow ( this table, IList pdfColumnsDefinitions, string summaryProperty, string labelProperty, PdfRpt.Core.Contracts.CellAttributes summaryCell, PdfRpt.Core.Contracts.CellAttributes labelCell, PdfRpt.Core.Contracts.CellAttributes emptyCell, IColumnItemsTemplate itemsTemplate ) : void

Adds a SummaryRow to an existing PdfGrid

CloneMainTableStructure ( DocumentPreferences pageSetup, IList pdfColumnsDefinitions ) : PdfGrid

To add manual AddSummaryRows, we need to create a clone of the MainTable's structure.

CreateEmptyRowTable ( string phrase = " ", float widthPercentage = 100, float fixedHeight = 35, int border ) : PdfGrid

Creates a new PdfGrid with one column and row.

SimpleTable ( int columnsNumber, IList pdfCellAttributesList ) : PdfGrid

Creates a simple PdfGrid.

SimpleTable ( int columnsNumber, IList pdfCellAttributesList, BaseColor nullRowBackgroundColor, bool showBorder = true ) : PdfGrid

Creates a simple PdfGrid.

SimpleTable ( int columnsNumber, IList pdfCellAttributesList, bool showBorder ) : PdfGrid

Creates a simple PdfGrid.

Private Methods

Method Description
addSimpleRowCell ( PdfGrid table, CellBasicProperties>.Action cellDataItem ) : void

Method Details

AddBorderToTable() public static method

Adds a border to an existing PdfGrid
public static AddBorderToTable ( this table ) : PdfGrid
table this table
return PdfRpt.Core.Contracts.PdfGrid

AddBorderToTable() public static method

Adds a border to an existing PdfGrid
public static AddBorderToTable ( this table, BaseColor borderColor, float spacingBefore ) : PdfGrid
table this Table
borderColor iTextSharp.text.BaseColor Border's color
spacingBefore float Spacing before the table
return PdfRpt.Core.Contracts.PdfGrid

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

AddSimpleRow() public static method

Adds a new row to the specified table. The default IColumnItemsTemplate would be TextBlockField.
public static AddSimpleRow ( this table ) : void
table this
return void

AddSummaryRow() public static method

Adds a SummaryRow to an existing PdfGrid
public static AddSummaryRow ( this table, IList pdfColumnsDefinitions, string summaryProperty, string labelProperty, PdfRpt.Core.Contracts.CellAttributes summaryCell, PdfRpt.Core.Contracts.CellAttributes labelCell, PdfRpt.Core.Contracts.CellAttributes emptyCell, IColumnItemsTemplate itemsTemplate ) : void
table this An existing PdfGrid
pdfColumnsDefinitions IList List of the PdfColumnAttributes
summaryProperty string Sets the location of summary cell's data
labelProperty string Sets the location of summary cell's label
summaryCell PdfRpt.Core.Contracts.CellAttributes SummaryCell's Attributes
labelCell PdfRpt.Core.Contracts.CellAttributes LabelCell's Attributes
emptyCell PdfRpt.Core.Contracts.CellAttributes The other not in use cell's Attributes
itemsTemplate IColumnItemsTemplate Default ItemsTemplate
return void

CloneMainTableStructure() public static method

To add manual AddSummaryRows, we need to create a clone of the MainTable's structure.
public static CloneMainTableStructure ( DocumentPreferences pageSetup, IList pdfColumnsDefinitions ) : PdfGrid
pageSetup PdfRpt.Core.Contracts.DocumentPreferences Document settings
pdfColumnsDefinitions IList List of the PdfColumnAttributes
return PdfRpt.Core.Contracts.PdfGrid

CreateEmptyRowTable() public static method

Creates a new PdfGrid with one column and row.
public static CreateEmptyRowTable ( string phrase = " ", float widthPercentage = 100, float fixedHeight = 35, int border ) : PdfGrid
phrase string An optional phrase to display
widthPercentage float Width of the table
fixedHeight float Height of the table
border int Border width
return PdfRpt.Core.Contracts.PdfGrid

SimpleTable() public static method

Creates a simple PdfGrid.
public static SimpleTable ( int columnsNumber, IList pdfCellAttributesList ) : PdfGrid
columnsNumber int number of columns
pdfCellAttributesList IList PdfCells Attributes List
return PdfRpt.Core.Contracts.PdfGrid

SimpleTable() public static method

Creates a simple PdfGrid.
public static SimpleTable ( int columnsNumber, IList pdfCellAttributesList, BaseColor nullRowBackgroundColor, bool showBorder = true ) : PdfGrid
columnsNumber int Number of columns
pdfCellAttributesList IList PdfCells Attributes List
nullRowBackgroundColor iTextSharp.text.BaseColor You can set the cells attributes to null. nullRowBackgroundColor indicates background color of these cells. Default color is white here.
showBorder bool Indicates visibility of the table's border
return PdfRpt.Core.Contracts.PdfGrid

SimpleTable() public static method

Creates a simple PdfGrid.
public static SimpleTable ( int columnsNumber, IList pdfCellAttributesList, bool showBorder ) : PdfGrid
columnsNumber int number of columns
pdfCellAttributesList IList PdfCells Attributes List
showBorder bool Indicates visibility of the table's border
return PdfRpt.Core.Contracts.PdfGrid