ExcelReportGenerator
StockSharp.Reporting
The report generator for the strategy in the Excel format.
Inherits: BaseReportGenerator
Constructors
ExcelReportGenerator
public ExcelReportGenerator(IExcelWorkerProvider provider, ReadOnlyMemory<byte> template)
excelReportGenerator = ExcelReportGenerator(provider, template)
The report generator for the strategy in the Excel format.
- provider
- IExcelWorkerProvider.
- template
- The template bytes to be copied into report and filled. Thread-safe for parallel use.
Properties
Decimals
public int Decimals { get; set; }
value = excelReportGenerator.Decimals
excelReportGenerator.Decimals = value
The number of decimal places for formatting. By default, it equals to 2.
Extension
public override string Extension { get; }
value = excelReportGenerator.Extension
Extension without leading dot char.
Template
public ReadOnlyMemory<byte> Template { get; }
value = excelReportGenerator.Template
The template bytes to be copied into report and filled.
Methods
GetTemplate
public static byte[] GetTemplate()
result = ExcelReportGenerator.GetTemplate()
Gets the embedded template from resources as byte array.
Returns: Template bytes, or empty if not found.
OnGenerate
protected override ValueTask OnGenerate(IReportSource source, Stream stream, CancellationToken cancellationToken)
result = excelReportGenerator.OnGenerate(source, stream, cancellationToken)
Generates the report content.
- source
- IReportSource.
- stream
- The stream to write the report to.
- cancellationToken
- CancellationToken.
SwitchSheet
private static void SwitchSheet(IExcelWorker worker, string localizedName, string englishName)
ExcelReportGenerator.SwitchSheet(worker, localizedName, englishName)
Switch to sheet by localized name, falling back to English name if not found.