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

Free Support Forum - aspose.com

Convert the code from 8.4.20 to latest version

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)


Few places are broken if I update to the latest reference dll.

for example:
Dim OldDescStyle As Aspose.Cells.GridDesktop.Style = UserSheet.Cells(1, RowIndex).GetStyle()

"UserSheet.Rows(RowIndex).GetStyle()"


The worst case is, when i got no complains from the compiler, but in the runtime the code does not do what it did in the old dll version.

is there any documentation tell me the major changes between 8.4.20 and the lastet dll? or any easy conversion that i can use.

thanks.

Hi,


Thanks for providing us some details.

To check major changes in the features and APIs, we recommend you to browse public APIs changes of Releases Notes and migration sections here for your reference:
https://docs.aspose.com/display/cellsnet/Migrating+from+Earlier+Versions+of+Aspose.Cells
https://docs.aspose.com/display/cellsnet/Release+Notes

Now come to your issue, I am afraid, we need your sample project (runnable) that should be created using our latest version/fix: Aspose.Cells.GridDesktop v17.6, zip the project and post us here, we will check it soon.

By the way, you may also refer to the document on how to apply formatting on cells/range of cells for your reference:
https://docs.aspose.com/display/cellsnet/Formatting+a+Range+of+Cells

Thank you.
1 Like

you can download my sample project from my dropbox.


https://www.dropbox.com/s/3xc4uedjmgpl4ct/dll_Version_Issue.zip?dl=0

i also attached few screenshots comparing the runtime results. the real issue is the code has no complains but it performs differently.


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)
<span style=“font-size: 10pt; font-family: “Courier New”; color: rgb(43, 145, 175);”>Worksheet<span style=“font-size: 10pt; font-family: “Courier New”;”> 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.