cancel
Showing results for 
Search instead for 
Did you mean: 

how to make number to national digits Arabic in runtime use Crystal Reports 2012 ?

0 Kudos
I'm use VS2012 and after run to CrystalReport show number (0123456789) ,

I want the numbers as follows (٠١٢٣٤٥٦٧٨۹) after runtime

I'm use code to run CrystalReport :

Dim dt As New DataTable  
With dt  
.Columns.Add("ID")  
End With  
For Each dr As DataGridViewRow In Me.CalculationTableDataGridView.Rows  dt.Rows.Add(dr.Cells("ID").Value)  
Next
Dim rptdoc As CrystalDecisions.CrystalReports.Engine.ReportDocument  rptdoc = New CrystalReportCount  
rptdoc.SetDataSource(dt)  
CRCountTotal.CrystalReportViewer1.ReportSource = rptdoc  
CRCountTotal.ShowDialog()  
CRCountTotal.Dispose()


0 Kudos

waiting for help ....

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

So I pasted the text into a CR Text object and it shows fine.

The issue appears to be the Database driver you are using may be interpreting the wrong font.

Oracle for example has a Language property to set locale, others may have also.

Your code appears to be using the Dataset or XML data source so you need to look there for a solution.

Don

Answers (4)

Answers (4)

0 Kudos

What is the appropriate font for the appearance of the figure as required is (٠١٢٣٤٥٦٧٨۹) ?

0 Kudos

In VS if you preview the report does that work?

Or in CR Designer does it work?

As I said, design the report using the font, not set it in code to test.

Try MS Arial Unicode and see if that works.

Don

0 Kudos

hi Don Williams ,

I Try (MS Arial Unicode) but it did not work !

Is there a Font that numbers are like this (٠١٢٣٤٥٦٧٨۹) ?

0 Kudos

I try one more then for code but not succeed :

Dim renderCulture AsCultureInfo = CultureInfo.CreateSpecificCulture("ar-IQ")
renderCulture.NumberFormat.DigitSubstitution = DigitShapes.NativeNational
Thread.CurrentThread.CurrentCulture = renderCulture
Dim rptdoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
rptdoc = NewCrystalReportCount
rptdoc.SetDataSource(dt)
CRCountTotal.CrystalReportViewer1.SetProductLocale("ar-IQ")
Dim testLocale As CrystalDecisions.ReportAppServer.DataDefModel.CeLocale = CeLocale.ceLocaleArabicIraq
rptdoc.ReportClientDocument.LocaleID = testLocale
rptdoc.ReportClientDocument.PreferredViewingLocaleID = testLocale
rptdoc.ReportClientDocument.ProductLocaleID = testLocale
CRCountTotal.CrystalReportViewer1.ReportSource = rptdoc
CRCountTotal.ShowDialog()
CRCountTotal.Dispose()
0 Kudos

Download SP 21, you are using SP 5, and try again:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Read the info on the WIKI, lots of info you need to know when updating your app.

Don

0 Kudos

thanks Don Williams , I'm Download and install (CRforVS_13_0_21) in Visual Studio 2012 but show error when run report:

An error occurred creating the form. See Exception.InnerException for details. The error is: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception >>> why ?

0 Kudos

I try again to install (Visual Studio 2017) and (CRforVS_13_0_21) but show same problem and not succeed ! why ? If the font problem is the right font to solve this problem (What is the name of the default font in Windows) ?

0 Kudos

Did you remove the CR assemblies and add the 3500 version back in?

0 Kudos

You need to format the field with a font that supports those characters.

0 Kudos

thanks Don Williams , I try to change format the field with a font but did not succeed > what is the solution ?

0 Kudos

What version of CR for VS are you using?

0 Kudos

Hi Don Williams , I use version CR for VS 13_0_5 _2