C# Class PdfRpt.Core.Helper.TableHelper

PdfGrid helper class
Afficher le fichier Open project: VahidN/PdfReport

Méthodes publiques

Méthode 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

Méthode Description
addSimpleRowCell ( PdfGrid table, CellBasicProperties>.Action cellDataItem ) : void

Method Details

AddBorderToTable() public static méthode

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

AddBorderToTable() public static méthode

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
Résultat PdfRpt.Core.Contracts.PdfGrid

AddDefaultEmptyDataSourceTable() public static méthode

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
Résultat void

AddSimpleRow() public static méthode

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

AddSummaryRow() public static méthode

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
Résultat void

CloneMainTableStructure() public static méthode

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
Résultat PdfRpt.Core.Contracts.PdfGrid

CreateEmptyRowTable() public static méthode

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
Résultat PdfRpt.Core.Contracts.PdfGrid

SimpleTable() public static méthode

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

SimpleTable() public static méthode

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
Résultat PdfRpt.Core.Contracts.PdfGrid

SimpleTable() public static méthode

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
Résultat PdfRpt.Core.Contracts.PdfGrid