ZennoLab Assemblies Documentation
SetCellStyle Method
Example 

Type: System.Int32

The cell's column, zero-based index.

Type: System.Int32

The cell's row, zero-based index.

Type: ZennoLab.InterfacesLibrary.ProjectModel.ZennoTableStyle

The style for excel cell.

Sets style for excel cell.
Syntax
void SetCellStyle( 
   int column,
   int row,
   ZennoTableStyle style
)

Parameters

column

Type: System.Int32

The cell's column, zero-based index.

row

Type: System.Int32

The cell's row, zero-based index.

style

Type: ZennoLab.InterfacesLibrary.ProjectModel.ZennoTableStyle

The style for excel cell.

Example
The following code using IZennoTable Interface for setting cell style.
// get table by name "MyTable"
var table = project.Tables["MyTable"];
 
// create style
var style = new ZennoTableStyle
{
    HorizontalAlignment = InterfacesLibrary.Enums.Table.ExcelStyle.HorizontalAlignment.Right,
    VerticalAlignment = InterfacesLibrary.Enums.Table.ExcelStyle.VerticalAlignment.Bottom,
    Font = new Font("Comic Sans MS", 20, FontStyle.Italic | FontStyle.Underline, GraphicsUnit.Point),
    FontColor = Color.Red
};
style.SetBorder(InterfacesLibrary.Enums.Table.ExcelStyle.Borders.Right | InterfacesLibrary.Enums.Table.ExcelStyle.Borders.DiagonalUp, Color.Blue, InterfacesLibrary.Enums.Table.ExcelStyle.LineStyle.DashDot);
            
// set style
table.SetCellStyle(0, 0, style);
// get table by name "MyTable"
$table = $project->Tables->get_Item("MyTable");
 
// create style
$style = new ZennoTableStyle;
$style->HorizontalAlignment = InterfacesLibrary::Enums::Table::ExcelStyle::HorizontalAlignment->Right;
$style->VerticalAlignment = InterfacesLibrary::Enums::Table::ExcelStyle::VerticalAlignment->Bottom;
$style->Font = new Font("Comic Sans MS", 20, FontStyle->Italic | FontStyle->Underline, GraphicsUnit->Point);
$style->FontColor = Color->Red;
style->SetBorder(InterfacesLibrary::Enums::Table::ExcelStyle::Borders->Right | InterfacesLibrary::Enums::Table::ExcelStyle::Borders->DiagonalUp, Color->Blue, InterfacesLibrary::Enums::Table::ExcelStyle::LineStyle->DashDot);
            
// set style
$table->SetCellStyle(0, 0, $style);
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

IZennoTable Interface
IZennoTable Members
SetRowStyle Method
SetColumnStyle Method

Send Feedback