Arabic Numbers

Dear Aspose,

I’m having a report that retrieves data from the database and generate a word document based on a predefined template files.

The issue is the numbers are displayed in English even when the numeral is set to context, and I wanted to be displayed in English when it’s in the English text and in Arabic when it’s in an Arabic text

Notes:

  • I’m using office word 2007.
  • To set the numeral:
    • Click on the office button.
    • Click on word options.
    • Select advance from the left pane.
    • Scroll down to the numeral and set it to context.
  • Attached is a document that contains a sample created by hand.

Hi

Thanks for your request. It is not quite clear for me what you mean. Could you please also attach your sample output document and code, which you use to generate it? I will check the issue and provide you more information.

Best regards.

Hi,

Attached is a sample report generator run the application 2 times

the first on enter “Loai 123” in the text box and result should be like English_Result.docx in the attachment which is, i dont have any problems so far but on the second enter run of the application enter “لؤي 123” in the text box and the result should be like Arabic_Result.docx in the attachment which is not.

hope this will make the idea is clear to you.

thanks alot for your support.

Hi

Thank you for additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue in our defect database. You will be notified once the problem is resolved.

As a temporary workaround of this issue, you can try using the following code:

Document doc = new Document(@"Test001\Arabic_Template.docx");
doc.MailMerge.MergeField += MailMerge_MergeField;
doc.MailMerge.Execute(new string[] { "Text" }, new object[] { "لؤي 123" });
doc.Save(@"Test001\out.doc");
void MailMerge_MergeField(object sender, Aspose.Words.Reporting.MergeFieldEventArgs e)
{
    // Create DocumentBuidler.
    DocumentBuilder builder = new DocumentBuilder(e.Document);

    // Move to mergefield.
    builder.MoveToField(e.Field, true);

    // Set Bidi property.
    builder.Font.Bidi = true;

    // Insert value.
    builder.Write(e.FieldValue.ToString());

    e.Text = string.Empty;
}

Hope this helps.

Best regards.

The issues you have found earlier (filed as WORDSNET-3029) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.