We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Cells.GridWeb WebWorksheet currency and other formatting issues

Hi Scott,

Thanks for using Aspose.Cells for GridWeb.

We were able to observe this issue using latest version of Aspose.Cells for GridWeb. TableItemStyle.Custom is not functional in the GridWeb.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43126 - TableItemStyle.Custom is not functional in the GridWeb

Hi Scott,

Thanks for using Aspose.Cells for GridWeb.

We have fixed this issue now.

  • CELLSNET-43126 - TableItemStyle.Custom is not functional in the GridWeb

We will provide you a fix in couple of
days after incorporating other enhancements and fixes and conducting
some extensive testing. Once, it is available for you, we will let you
know asap by posting in this thread.

Hi,


Please try our latest version/fix: Aspose.Cells.GridWeb v8.2.2.2 (attached), we have fixed your issue now.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSNET-43126) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

I tested version 8.3.0.0, and it looks like all of my defect issues that I have discovered have been resolved.


Has the enhancement for locale based currency format been considered? A number of my customers are having issues that has no easy work around.

Hi Scott,

Thanks for using Aspose.Cells for GridWeb.

Kindly elaborate your currency format issue in more detail so that we could evaluate it at our end and log it in our database for its implementation.

For Aspose Cells GridWeb, number formats "#,##0.00" (en-US) and "# ##0.00" (pl-PL) display correctly. However when I want to use Dutch (nl-NL) "#.##0,00" I see unexpected results in the formatting. There is no thousands separator ".", and there are 3 trailing zeros after the decimal point ",". Screenshots are attached.

I am using the following code to set custom number formats:

Aspose.Cells.GridWeb.TableItemStyle style = new Aspose.Cells.GridWeb.TableItemStyle();
WebWorksheet sheet = GridWeb1.WebWorksheets[0];
string NumberFormat = "#,##0.00"

style.HorizontalAlign = HorizontalAlign.Right;
style.Custom = NumberFormat;
style.Font.Bold = true;
sheet.Cells[0, 0].SetStyle(style);

Hi Scott,

Thanks for your screenshots and using Aspose.Cells for GridWeb.

We were able to observe this issue as shown in your screenshots by testing it with the following sample code inside the GridWeb. We found Dutch custom number format is not working in GridWeb.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43232 - Dutch Custom Number Format is not working in GridWeb

C#

Aspose.Cells.GridWeb.TableItemStyle style = new Aspose.Cells.GridWeb.TableItemStyle();

WebWorksheet sheet = GridWeb1.WebWorksheets[0];


sheet.Cells[“A1”].PutValue(123456);


string NumberFormat = “#.##0,00”;


style.HorizontalAlign = HorizontalAlign.Right;

style.Custom = NumberFormat;

style.Font.Bold = true;

sheet.Cells[0, 0].SetStyle(style);

Hi Scott,

Thanks for using Aspose.Cells for GridWeb.

We have looked into this issue further and found that GridWeb is working as expected. You will have to first change your Region to Dutch and then run your code which you posted and GridWeb will show the correct formatted values.

Please see the screenshot attached for your reference.

Please remember whenever you change region you will have to reload the Excel file because we do not check region environment every time.

C#


if (Page.IsPostBack == false && this.GridWeb1.IsPostBack == false)

{

string filePath = Server.MapPath("~/ExcelFile/source.xlsx");



Aspose.Cells.GridWeb.TableItemStyle style = new Aspose.Cells.GridWeb.TableItemStyle();

WebWorksheet sheet = GridWeb1.WebWorksheets[0];


sheet.Cells[“A1”].PutValue(123456);


string NumberFormat = “#,##0.00”;


style.HorizontalAlign = HorizontalAlign.Right;

style.Custom = NumberFormat;

style.Font.Bold = true;

sheet.Cells[0, 0].SetStyle(style);


}

It’s good to see that this is possible with the existing code. However I’m not loading an Excel file, I am loading data from XML. My use case is such that the regional and client settings are not the same. Example: server settings are “en-US” and my client regional settings are “nl-NL”, or the server settings are “nl-NL” and client settings are “en-US”.


Where would I need to set the regional settings for this to display correctly? My sample project in this post still applies.
https://forum.aspose.com/t/72669

Where WorksheetXML is the data I am loading.

this._pageObject.Session[“WorksheetXML-” + _userNameInternal] = WorksheetXML;

Hi Scott,

Thanks for your posting and using Aspose.Cells for GridWeb.

You do not need to set the Region or Culture from Control Panel. You can set it in run time. The following code sets the Region or Culture of the Thread to Dutch.

Now the region or culture of your thread will be set to Dutch even if the culture or region of your computer or control panel is set to USA.

C#


System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(“nl-NL”);

System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(“nl-NL”);


Please see the following sample code. It renders value 123456 inside the GridWeb according to Dutch culture i.e 123.456,00 as shown in this screenshot.

C#
if (Page.IsPostBack == false && this.GridWeb1.IsPostBack == false)
{
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("nl-NL");
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");


Aspose.Cells.GridWeb.TableItemStyle style = new Aspose.Cells.GridWeb.TableItemStyle();
WebWorksheet sheet = GridWeb1.WebWorksheets[0];

sheet.Cells["A1"].PutValue(123456);

string NumberFormat = "#,##0.00";

style.HorizontalAlign = HorizontalAlign.Right;
style.Custom = NumberFormat;
style.Font.Bold = true;
sheet.Cells[0, 0].SetStyle(style);

}

Thank you for the update, and it looks like I am getting closer to where I want to be.


To be clear, the format “#,##0.00” will be used for all cultures, and the thread will handle all the formatting?

What happens if the System.Threading.Thread.CurrentThread.CurrentCulture and System.Threading.Thread.CurrentThread.CurrentUICulture are changed during another process?

My grid is initially loading with the correct formatting, but the calculations are returning incorrectly.




Hi Scott,

Thanks for your posting and using Aspose.Cells for GridWeb.

Yes, your understanding is correct. Once, you will change the thread culture, GridWeb will show you the same custom format according to the thread culture.

For the formula calculation issue, please provide some sample code or sample project so that we could investigate at our end and fix this issue.