Style.Orientation gone?

Hi,

I’ve just upgraded to 2.8 to find out that the Style.Orientation property seems to be gone.
Any reason/workaround for this?

Regards

Kai

Dear Kai,

It’s obsolete and removed in v2.8. Please use Style.Rotation for the same purpose.

Laurence,

thanks for this hint; sure I have replaced my code using a +90/-90 degrees rotation.

Maybe for the future: Instead of silently removing a property/method you could keep it for a couple of releases but issue a compiler warning in case someone uses the property.

Regards

Kai

Hi Kai,

Thanks for your suggestion.

Actually in the API reference, we already obsolete this property about one year before. We will add compiler warnings for other obsoleted methods or properties.


@Kai_Iske,
Aspose.Excel is discontinued and is replaced by another latest product Aspose.Cells which is rich in terms of features and performance as compared to its predecessor and other similar products in the market. You can not only rotate text in a cell using this product but also configure other alignment settings like horizontal/vertical alignment, indentation, orientation and set text direction. Following example sets the orientation of text in a cell using Aspose.Cells.

// Instantiating a Workbook object
Workbook workbook = new Workbook();

// Obtaining the reference of the worksheet
Worksheet worksheet = workbook.Worksheets[0];

// Accessing the "A1" cell from the worksheet
Aspose.Cells.Cell cell = worksheet.Cells["A1"];

// Adding some value to the "A1" cell
cell.PutValue("Visit Aspose!");

// Setting the horizontal alignment of the text in the "A1" cell
Style style = cell.GetStyle();
            
// Setting the rotation of the text (inside the cell) to 25
style.RotationAngle = 25;

cell.SetStyle(style);

// Saving the Excel file
workbook.Save(dataDir + "book1.out.xls", SaveFormat.Excel97To2003);

Following articles can be referred to get more information about configuring text in cells:
Configuring Alignment Settings
Format Cells using GetStyle and SetStyle Methods

A free trial version can be downloaded here:
Aspose.Cells for .NET(Latest version)

You can download a ready to run solution here that can be used to test different features of this product without any coding.