Arabic numbers are converted to "English" numbers

Hi,

I am using Aspose.Word.DocumentBuilder to build a word report by processing and adding word and excel document into it.

This how I proceed:

  1. Create DocumentBuilder object
  2. Process and Add Word document to documentBuilder
  3. documentBuilder.MoveToDocumentEnd()
  4. Process and Add Excel document to documentBuilder
  5. documentBuilder.MoveToDocumentEnd()
  6. Final Word report generated.

The problem is the following :
The excel document contains Arabic/Persian numbers. When I process the excel document, the numbers are transformed to “English” numbers and final report contains English numbers.

Hint : I notice there are some DocumentBuilder properties has been changed (maybe reset) after the step 3.

To debug this situation I started looking at DocumentBuilders’ properties that has been changed and try to find which one caused the number to be transformed.

As the DocumentBuilder object is huge and it will take me a crazy time to verify all the properties, I am asking you to tell me which property (or properties) that cause my issue.

Thank you,

Hi Jawad,

Thanks for your query. Please explain point number 4. Unfortunately, inserting new OLE objects into Word documents and updating existing OLE objects is not supported at the moment.

Please share your document along with your code for investigation purposes.

Hi,

What basically I do in step 4 is create table in DocumentBuilder and copy cells from Excel to the table. I don’t think that is the problem.
Unfortunately, I cannot provide you with a sample as that will take me a lot of time.
Actually I don’t think it an Aspose.Cells bug but I couldn’t figure out which property in DocumentBuilder or in Words.Paragraph responsible for number format. This is where I need your help. I don’t why in a pure Arabic environment I end up with “English” numbers in my generated document.

My environment is Windows 7 Arabic, Office Arabic, Regional setting for U.A.E with Arabic numbers.

Hi Jawad,

Thanks for sharing the information. It would be great if you please share your Excel file for investigation purposes.

Here attached the excel file and word file I am using.

They are pretty sample :
The excel has only one cell with the value 123.
The word file sample too: One paragraph with numbers.

When I copy the word paragraph and the excel cell to DocumentBuilder and I generate the report, the numbers from the word remain Arabic and the numbers the cell become English.

Thank you,

Hi Jawad,

I have used the following code snippet and have not found any issue while using latest version of Aspose.Words for .NET and Aspose.Cell for .NET. Please use the latest version of Aspose.Words for .NET and Aspose.Cell for .NET.

I have attached the output file with this post. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "input.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToDocumentEnd();
// Open Excel workbook
Workbook workbook = new Workbook(MyDir + "input.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
builder.Write(worksheet.Cells[0, 0].StringValue);
builder.MoveToDocumentEnd();
doc.Save(MyDir + "AsposeOut.docx");

OK. Let’s try something in your code that might help me :

I will ask you to do the opposite path:

When we run your code, the numbers in the cell are displayed correctly
(in Arabic) in AsposeOut.docx. My new question is : In your code, if I
want the numbers to be displayed in English in AsposeOut.docx, what
should I do? (using the same arabic environment).

As I said, this is not an Aspose bug. I don’t think you will find any problem with Aspose in Arabic. It is expected that your code to be working. And using the latest won’t help. What I am looking for is a name of a Propery. I did found nothing on your documentation that’s why I am posting in your forum. I think by answer my question above, I will get closer to my response.

Thank you,

Hi Jawad,

Thanks for your query. Do you want to convert Arabic numbers to English numbers in your shared Doc file?

Yes.

I want now use your code, copy the shared documents to the DocumentBuilder and save it in AsposeOut.docx with English numbers.

Hi Jawad,

Thanks for sharing the details. Unfortunately, the
requested feature is not supported yet in Aspose.Words. I had already logged
this feature request as WORDSNET-6661 in our issue tracking
system. I have linked this forum thread to the same feature and you will
be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

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

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