水晶报告中的阿拉伯数字

时间:2018-03-31 09:33:29

标签: c# crystal-reports windows-10

我无法在水晶报告中显示阿拉伯数字,在报告预览(设计)中显示阿拉伯数字apear。阿拉伯数字在运行时强制转换为英语,我需要用阿拉伯语而不是英语显示它。我试着改变windows语言坐着不行 注意:使用win 10时会出现此问题,但是当我使用win 7时,每个人都进展顺利

        private void btnPrint_Click(object sender, EventArgs e)
    {
        Cursor.Current = Cursors.WaitCursor;
        BL.CLSReport report = new BL.CLSReport();

        /*
        var newCulture = CultureInfo.CreateSpecificCulture("ar-EG");
        Thread.CurrentThread.CurrentUICulture = newCulture;
        Thread.CurrentThread.CurrentCulture = newCulture;
        */
        Report.RptPersent persent = new Report.RptPersent();

        persent.SetDataSource(report.data_report(ColDate.Value,txtNu.Text,txtAdDay.Text).Tables["RptPersent"]);
        Report.FRMRpt frm = new Report.FRMRpt();
        frm.CRView.ReportSource = persent;
        frm.CRView.Refresh();
        frm.Show();
        Cursor.Current = Cursors.Default;
        DialogResult DR= MessageBox.Show("هل تريد تقليل المده المتبقيه بمقدار 1","هااااااام",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);

        byte decr = Convert.ToByte(txtNu.Text);
        if (DR==DialogResult.OK &&  decr > 0)
        {
            Properties.Settings.Default.DayRemainder = --decr;
            txtNu.Text = decr.ToString();
            Properties.Settings.Default.Save();

        }
    }

enter image description here

1 个答案:

答案 0 :(得分:0)

从报告本身你可以解决....从显示字符串选项添加新公式转换你的数字(ToText),然后将数字替换为阿拉伯数字如下:

stringVar StrArb := ToText(your field);

StrArb := Replace (StrArb ,"0" , "٠" );
StrArb := Replace (StrArb ,"1" ,"١" );
StrArb := Replace (StrArb ,"2" ,"٢" );
StrArb := Replace (StrArb ,"3" ,"٣" );
StrArb := Replace (StrArb ,"4" ,"٤" );
StrArb := Replace (StrArb ,"5" ,"٥" );
StrArb := Replace (StrArb ,"6" ,"٦" );
StrArb := Replace (StrArb ,"7" ,"٧" );
StrArb := Replace (StrArb ,"8" ,"٨" );
StrArb := Replace (StrArb ,"9" ,"٩" );