Microsoft Developer Network > 포럼 홈 > Crystal Reports for Visual Studio > See arabic number while export from crystal report to pdf
질문하기질문하기
 

답변됨See arabic number while export from crystal report to pdf

  • 2008년 7월 15일 화요일 오후 1:16Ahmedkiwi 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi all,

    This is the question that no body answer it in the internet

    I build application in visual studio 2005 and i created a report in crystal report that integrated with the VS2005

     i see the number in arabic in the web and also i see the number in arabic in the preview of the crystal report

    but when i export the report to pdf , the number changed to english

    i don't know why and no body know ho to do that in the internet
    from three weeks i tried to solve this problem but without any advance

    I hope any advanced programmer here can tell me the answer

    thanks

답변

  • 2008년 7월 20일 일요일 오전 11:45Ahmedkiwi 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨
     Ok

    I found the solution

    I think im the first one who post the solution for this problem
    I search before in all english and arabic threads but without a good solution
    Some one tell me that you have to change the language setting from control panel...... but this not a good solution and not the solution at all

    Some one tell me that you have to change the version for crystal report.... but this not the solution also

    the solution is:

    We have to build a function that change the character before we export the crystal report to pdf
    and also first we have to know the character code of the arabic number, which are:

    "0", (&#1632)

    "1", (&#1633)

    "2", (&#1634)

    "3", (&#1635)

    "4", (&#1636)

    "5", (&#1637)

    "6", (&#1638)

    "7", (&#1639)

    "8", (&#1640)

    "9", (&#1641)

    so now we can change the Text in the text box control by this statement:

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("0", ChrW(1632))

    and the complete function that i build for this problem is named  ChangeToArabicNumber()
    i make it public for the pages who have a master page, so the complete code is:

    Private Sub ChangeToArabicNumber()

    'Eng.Ahmed Rashid Al-Farhan

     

    Dim ArNumTextBox As TextBox

    For Each ctlMaster As Control In Page.Controls

    If TypeOf ctlMaster Is MasterPage Then

     

    For Each ctlForm As Control In ctlMaster.Controls

    If TypeOf ctlForm Is HtmlForm Then

     

    For Each ctlContent As Control In ctlForm.Controls

    If TypeOf ctlContent Is ContentPlaceHolder Then

     

    For Each ctlChild As Control In ctlContent.Controls

    If TypeOf (ctlChild) Is TextBox Then

     

    ArNumTextBox = ctlChild

    ' Case "0"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("0", ChrW(1632))

    ' Case "1"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("1", ChrW(1633))

    ' Case "2"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("2", ChrW(1634))

    ' Case "3"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("3", ChrW(1635))

    ' Case "4"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("4", ChrW(1636))

    ' Case "5"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("5", ChrW(1637))

    ' Case "6"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("6", ChrW(1638))

    ' Case "7"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("7", ChrW(1639))

    ' Case "8"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("8", ChrW(1640))

    ' Case "9"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("9", ChrW(1641))

    End If

     

    Next

     

    End If

     

    Next

     

    End If

     

    Next

     

    End If

     

    Next

     

    End Sub

    So know every one can get the report in pdf with arabic number
    thanks to all and best regards

    • 답변으로 표시됨Ahmedkiwi 2008년 7월 20일 일요일 오후 12:22
    •  

모든 응답

  • 2008년 7월 20일 일요일 오전 11:45Ahmedkiwi 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨
     Ok

    I found the solution

    I think im the first one who post the solution for this problem
    I search before in all english and arabic threads but without a good solution
    Some one tell me that you have to change the language setting from control panel...... but this not a good solution and not the solution at all

    Some one tell me that you have to change the version for crystal report.... but this not the solution also

    the solution is:

    We have to build a function that change the character before we export the crystal report to pdf
    and also first we have to know the character code of the arabic number, which are:

    "0", (&#1632)

    "1", (&#1633)

    "2", (&#1634)

    "3", (&#1635)

    "4", (&#1636)

    "5", (&#1637)

    "6", (&#1638)

    "7", (&#1639)

    "8", (&#1640)

    "9", (&#1641)

    so now we can change the Text in the text box control by this statement:

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("0", ChrW(1632))

    and the complete function that i build for this problem is named  ChangeToArabicNumber()
    i make it public for the pages who have a master page, so the complete code is:

    Private Sub ChangeToArabicNumber()

    'Eng.Ahmed Rashid Al-Farhan

     

    Dim ArNumTextBox As TextBox

    For Each ctlMaster As Control In Page.Controls

    If TypeOf ctlMaster Is MasterPage Then

     

    For Each ctlForm As Control In ctlMaster.Controls

    If TypeOf ctlForm Is HtmlForm Then

     

    For Each ctlContent As Control In ctlForm.Controls

    If TypeOf ctlContent Is ContentPlaceHolder Then

     

    For Each ctlChild As Control In ctlContent.Controls

    If TypeOf (ctlChild) Is TextBox Then

     

    ArNumTextBox = ctlChild

    ' Case "0"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("0", ChrW(1632))

    ' Case "1"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("1", ChrW(1633))

    ' Case "2"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("2", ChrW(1634))

    ' Case "3"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("3", ChrW(1635))

    ' Case "4"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("4", ChrW(1636))

    ' Case "5"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("5", ChrW(1637))

    ' Case "6"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("6", ChrW(1638))

    ' Case "7"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("7", ChrW(1639))

    ' Case "8"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("8", ChrW(1640))

    ' Case "9"

     

    ArNumTextBox.Text = ArNumTextBox.Text.Replace("9", ChrW(1641))

    End If

     

    Next

     

    End If

     

    Next

     

    End If

     

    Next

     

    End If

     

    Next

     

    End Sub

    So know every one can get the report in pdf with arabic number
    thanks to all and best regards

    • 답변으로 표시됨Ahmedkiwi 2008년 7월 20일 일요일 오후 12:22
    •  
  • 2009년 7월 26일 일요일 오후 4:44heat9070 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Please Would you upload a sample projects that uses your code to convert numberals to arabic format before exporting to PDF, Also I wanna ask again if this code make numbers and date view as arabic format in PDF

    Regards
    Mohamed