Skip to main content

SheetStyle

Definition

Namespace: Surya.Ab.Export.Client.Models
Assembly: Surya.Ab.Export.dll

It holds all style related properties for a Sheet and a common style property for all DataSets in that Sheet.

public class SheetStyle : ItemStyle

Inheritance ItemStyle -> SheetStyle

Properties

NameDefinition
HeaderStyleRepresents style properties for Header of the Sheet
FooterStyleRepresents style properties for Footer of the Sheet

Structure

public class SheetStyle : ItemStyle
{
public AbStyle? HeaderStyle { get; set; }
public AbStyle? FooterStyle { get; set; }
}

Example

// Get instance of SheetStyleBuilder
var sheetStyleBuilder = serviceProvider.GetRequiredService<ISheetStyleBuilder>();

// create and build SheetStyle
var sheetStyle = sheetStyleBuilder
.HeaderStyle(new AbStyle()
{
FontSize = 20,
BackgroundColor = Color.AliceBlue
})
.FooterStyle(new AbStyle()
{
FontSize = 8,
Color = Color.Brown
})
//Common Styles for all datasets in that sheet
.DatasetHeaderStyle(new AbStyle()
{
FontSize = 15,
Color = Color.Green
})
.DatasetTableHeaderStyle(new AbStyle()
{
FontSize = 12,
BackgroundColor = Color.Magenta
})
.DatasetBodyStyle(new AbStyle()
{
BackgroundColor = Color.LightYellow,
FontSize = 10
})
.Build()

Edit on GitHub