Syncfusion.XlsIO.Base
Example 


IncludeAlignment Property

True if the style includes the AddIndent, HorizontalAlignment, VerticalAlignment, WrapText, and Orientation properties. Read / write Boolean.
Syntax
'Declaration
 
Property IncludeAlignment As Boolean
'Usage
 
Dim instance As IExtendedFormat
Dim value As Boolean
 
instance.IncludeAlignment = value
 
value = instance.IncludeAlignment
bool IncludeAlignment {get; set;}
Example
The following code illustrates how to exclude alignment related settings for a specific IStyle object.
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Set text
            worksheet["C2"].Text = "Sample";
            worksheet["E2"].Text = "Sample";
            
            //Add style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set alignment
            style.HorizontalAlignment = ExcelHAlign.HAlignRight;
            
            //Set color
            style.ColorIndex = ExcelKnownColors.Red;
            
            //Set include alignment
            style.IncludeAlignment = false;
            
            //Set style
            worksheet["C2"].CellStyle = style;
            
            //Get extended format
            IExtendedFormat format = worksheet["E2"].CellStyle;
            
            //Set alignment
            format.HorizontalAlignment = ExcelHAlign.HAlignRight;
            
            //Set color
            format.ColorIndex = ExcelKnownColors.Red;
            
            //Set include alignment
            format.IncludeAlignment = false;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also