How to convert English numbers to arabic numbers

Posted by: fawzyfawzy880 on 15 September 2021, 7:18 am EST

  • Posted 15 September 2021, 7:18 am EST - Updated 30 September 2022, 7:32 am EST

    I use C1flex report 4.5 i need English number display in Arabic number

    i use this code before for active report 2

    please help me to use this code in C1flex report 4.5

    forgive me im poor in English

    '_______________ code vb6______________________

    Private Sub Detail_Format()

    On Error Resume Next

    Dim I As Long

    For I = 0 To Detail.Controls.Count - 1

    If (TypeName(Detail.Controls(I)) = “Field” Or TypeName(Detail.Controls(I)) = “Label”) Then

    Detail.Controls(I).Caption = Chr(254) & Detail.Controls(I).Text

    Detail.Controls(I).Text = Chr(254) & Detail.Controls(I).Text

    End If

    Next

    End Sub

  • Posted 19 September 2021, 6:14 pm EST

    Hi,

    We have responded to your query on your post : https://www.grapecity.com/forums/activereports/how-to-convert-english-num.

    Regards

    Avnish

  • Posted 19 September 2021, 10:53 pm EST - Updated 30 September 2022, 7:32 am EST

    First thanks for replay then

    Forgive me I have been infected with covid 19 for a long time for 3 months this is the example

    i use this function in vb.net but dosenot work with detail section

    Public Function TranslateNumerals(ByVal sIn As String) As String

    'تحويل الارقام الى عربى

    Dim enc As New System.Text.UTF8Encoding

    Dim utf8Decoder As System.Text.Decoder

    utf8Decoder = enc.GetDecoder

    Dim sTranslated = New System.Text.StringBuilder

    Dim cTransChar(1) As Char

    Dim bytes() As Byte = {217, 160}

    ’ Start Converting characters into Arabic mode.

    Dim aChars() As Char = sIn.ToCharArray

    For Each c As Char In aChars

    If Char.IsDigit(c) Then

    bytes(1) = 160 + CInt(Char.GetNumericValue(c))

    utf8Decoder.GetChars(bytes, 0, 2, cTransChar, 0)

    sTranslated.Append(cTransChar(0))

    Else

    sTranslated.Append(c)

    End If

    Next

    Return sTranslated.ToString

    End Function

  • Posted 19 September 2021, 10:56 pm EST

    Report Example

    tmpCB6D.ZIP

  • Posted 20 September 2021, 9:34 pm EST

    Hi,

    We have responded to your query on https://www.grapecity.com/forums/activereports/how-to-convert-english-num.

    Please continue this thread there.

    Regards

    Avnish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels