Background
| 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 purp ose to set a string value that indicates currency symbol of money. The default symbol is "$". |
Implementation details
When working with tables you may need to display currency values and they are represented in a unique way. In order to deal with currency values you may need to specify the formatting information for the table which can be set using TableFormatInfo class, which offers a property named CurrencySymbol which can be used to Get/Set the money symbol. You can use SymbolBehind property to specify either the currency symbol should be displayed behind or after the number. Use ZeroStyle property to specify the zero style for the values in table.
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.
// Create an object of TableFormatInfo class. Aspose.Pdf.Generator.TableFormatInfo tfi = new Aspose.Pdf.Generator.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);
' Create an object of TableFormatInfo class. Dim tfi As Aspose.Pdf.Generator.TableFormatInfo = New Aspose.Pdf.Generator.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)
