on 07-31-2012 7:09 AM
Dear Friends,
How to apply Format mask in crystal reports dynamically,
we have diff type of clients from diff countries we need to apply format mask for Amount field dynamically.
for your reference bellow are types of formats we are using,
123456789.00
123456789.000
12,34,56,789.00
123,456,789.000
Knowing what format you want, pass in the correct structure to a formula.
E.g.;
If requirement1 is 123,456,789.000, then pass the following to the formula:
Picture ({customer.number}, 'xxx,xxx,xxx.xxx')
To pass in a formula you'd use code along the following lines:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form1
Inherits System.Windows.Forms.Form
Dim Report As New CrystalReport1()
Dim FormulaFields As FormulaFieldDefinitions
Dim FormulaField As FormulaFieldDefinition
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FormulaFields = Report.DataDefinition.FormulaFields
FormulaField = FormulaFields.Item(0)
FormulaField.Text = "[formula text]"
CrystalReportViewer1.ReportSource = Report
End Sub
For more information see the SAP Crystal Reports .NET SDK Developer Guide. Also, don't forget to use the search box in the top right corner of this web page. Fair amount of info there. E.g.:
KB - 1215543 - How to format strings and numbers using the Picture function
- Ludek
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.