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

Free Support Forum - aspose.com

Aspose and Web Job

Hi Team,

I have a code that handles the date manipulation properly on local machine but displays incorrect formatting when hosted on Azure webjobs.
the input file has 2020 data when I apply setstyle or applystyle where I want to change the format to “mmm-yy” , azure webjobs converts all the dates to 2022.

Also the sorter on dates is not working on Azure webjobs. If sorted in ascending order it takes the 2022 first and then sorts the 2020 data.

Is there a limitation that these functionalities of aspose don’t work on azure web jobs?
Can you please let me know ASAP?

Many Thanks
Donna Mitra

Hi @Donnamitra
Please provide us some test files, code snippets, or simple test projects to illustrate:
1, how do you apply setstyle or applystyle,
2, how do you sorter on dates in Azure webjobs.
Thank you.

Hi

the set style that sets the date to mmm-yy format
st = Workbook.CreateStyle();

st.Custom = “mmm-yy”;
StyleFlag flg = new StyleFlag();
flg.NumberFormat = true;
for (int f1 = 1; f1 < worksheetCells.MaxRow; f1++)
{
r1 = f1 + 1;
worksheet.Cells[“date_Column” + r1].SetStyle(st);

}

this is the sorter code that sorts the date column in ascending order
DataSorter sorter = Workbookt.DataSorter;

sorter.Order1 = Aspose.Cells.SortOrder.Ascending;
sorter.Key1 = CellsHelper.ColumnNameToIndex(“Date_column”);
var ca = new CellArea
{
StartRow = 1,
StartColumn = 0,
EndRow = cells_new.MaxRow,
EndColumn = cells_new.MaxColumn
};
sorter.Sort(cells_new, ca);

Best regards
Donna Mitra

Hi Leo
Any update on this?
Best regards
Donna Mitra

@Donnamitra,

Thanks for the sample code segments.

Could you please also zip and attach sample Excel files (input file(if any), output file, etc.). This will also help us to evaluate your issue precisely on our end.

@Donnamitra,
To help us understand your requirement and issue better, the provided resources need to include the source excel file, the expected result and the generated file of your web job. As you said the result is correct for local machine, please check whether the locale of the web jobs is same with your local machine. If not, you may try to explicitly specify the locale of your workbook as the same one with your local machine to check whether it can give you the expected result.