Aspose.Pdf

Display Currency symbol with table values

While displaying data in table over PDF file, we often have a requirement to display the currency symbols i.e. $ ¥ £ €, along with the data. Aspose.Pdf has a class named TableFormatInfo class, which contains the property named CurrencySymbol, that can server the purpose to set a string value that indicates currency symbol of money. The default symbol is "$".

TableFormatInfo has a property called SymbolBehind. If you set the value of this property to True, the output will be in the following format “2,086.93$” in which the currency symbol is behind the value. If the value for SymbolBehind is set to false the output format would be “$2,086.93”

Please use the following code snippet to achieve this.

 

[C#.NET]

// Create an object of TableFormatInfo class.

TableFormatInfo tfi = new TableFormatInfo();

 

//Sets a string value that indicate currency symbol of money, the default is "$".

tfi.CurrencySymbol = "$";

 

// Format the table in specified columns and rows with given TableFormatInfo

table.FormatTableWithFormatInfo(tfi,int firstColumn,int firstRow,int maxRows,int maxColumns);

 

[VB.NET]

‘ Create an object of TableFormatInfo class.

Dim tfi As TableFormatInfo = New TableFormatInfo()

 

‘Sets a string value that indicate currency symbol of money, the default is "$".

tfi.CurrencySymbol = "$"

 

‘Format the table in specified columns and rows with given TableFormatInfo  

table.FormatTableWithFormatInfo(tfi,int firstColumn,int firstRow,int maxRows,int maxColumns)