Setting localeid

can i set localeid so in my excel report the currency symbol gets changed?

thanks


This message was posted using Aspose.Live 2 Forum

Hi,

Well, I think you can set Regional and Language Options in your windows control panel settings.

Thank you.

My situation is, I have an option on the report to display the report in USD or local currency, if the user picks the local currency option then I need to show the numbers based on that currency,so I was looking to set the locale in the .net code, so that excel can do the formatting and change the currency symbol ?

Hello, I would like to know if this can be done with the current aspose version or not? Thanks.

Yes, you can make it. Please try:

Workbook wb = new Workbook();
Worksheet sheet = wb.Worksheets[0];
Cell cell = sheet.Cells["A1"];


Aspose.Cells.Style style = cell.GetStyle();
style.Number = 7;
cell.SetStyle(style);
cell.PutValue(1234.56);

sheet.Cells.SetColumnWidth(0, 10);

wb.Save("d:\\test\\abc.xls");

Thanks for the reply, but I want to set the locale id so that it automatically chooses the currency symbol, like in .net code if we set the culture info the browser knows to show the correct currency symbol and takes care of date and the periods and comma formatting in numbers.