Skip to Content

How to apply Format mask in crystal reports

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,





Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 31, 2012 at 03:21 PM

    Knowing what format you want, pass in the correct structure to a formula.


    If requirement1 is 123,456,789.000, then pass the following to the formula:

    Picture ({customer.number}, '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 FormulaFieldDefinitionPrivate 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

    Share Your Knowledge in SCN Topic Spaces

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.