i am using aspose.grid.desktop dll version 8.4.20 and i have trouble to upgrade my code to use the latest version dll. (I believe the latest version is 17.5)
Hi,
you can download my sample project from my dropbox.
Hi,
Thanks for the sample project and screenshots.
I did evaluate your issue a bit using both older and new version. I think you need to update your code big time as we made changes in the APIs on applying formatting to cell(s)/range of cells. I would first request you to kindly check and run the following code snippets on how to apply formatting (fill color, font color and other attributes, etc.) on a cell/range of cells. Also, how to remove formatting, etc. The code is given in C# but you may change it to VB.NET if required:
e.g.
Sample code:
1).
Worksheet sheet =_grid.GetActiveWorksheet();//_grid is an object for
GridDesktop
// Setting sample values
GridCell cell = sheet.Cells["b7"];
cell.SetCellValue("1");
cell = sheet.Cells["c7"];
cell.SetCellValue("2");
cell = sheet.Cells["d7"];
cell.SetCellValue("3");
cell = sheet.Cells["e7"];
cell.SetCellValue("4");
// Creating a CellRange object starting from "B7" to "E7"
CellRange range = new CellRange(6, 1, 6, 4);
// Creating and setting Style attributes
Style style = new Style(this._grid);
//Set the cells shading (background) color
style.ForegroundColor = Color.Yellow;
style.Pattern = GridBackgroundType.Solid;
//Applying Style object on the range of cells
sheet.SetStyle(range, style);
//Or
//Apply style to certain cells
//Creating and setting Style attributes
//Style style = sheet.Cells[6].GetStyle();
//Set the cells shading (background) color
//style.ForegroundColor = Color.Yellow;
//style.Pattern = GridBackgroundType.Solid;
// Applying Style object on the range of cells
//sheet.Cells.SetStyle(6,1,1,4,style);
// Creating a customized Font object and change the font of the cells in the range
Font font = new Font("Courier New", 12f);
// Setting the font of range of cells to the customized Font object
sheet.SetFont(range, font);
// Setting the font color of range of cells to Red
sheet.SetFontColor(range, Color.Red);
2).
Worksheet sheet = _grid.GetActiveWorksheet();
sheet.Cells.ClearRange(6, 1, 6, 4);
In short, you got to first exercise the above code a bit and then change your sample code in accordance with latest APIs set to accomplish your task.
Let us know if you still have any issue.
Thank you.