DataSnapshot.Rows Property
- Namespace
TXTextControl.TXSheetControl. Data
- Package
TXTextControl.asTXSheetControl. Server TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Data. dll
Immutable rectangular rows of string, double, boolean or null values. Dates use ISO strings.
Syntax
public IReadOnlyList<IReadOnlyList<object?>> Rows { get; }
Property Value
IReadOnlyList<IReadOnlyList<object?>>.
Examples
Create a working report from bounded HTTP sales data. Supply an application-owned HttpClient and service URL; scope cached data to its actual audience.
using TXTextControl.TXSheetControl.Data;
using TXTextControl.TXSheetControl.Server;
async Task<byte[]> BuildDataSnapshotRowsAsync(ServerSheetControl control)
{
var book = control.Workbook;
var sheet = await book.Sheets.AtAsync(0);
var data = new DataSnapshot(["Region", "Revenue"], [["North", 42000], ["South", 38500]]);
await sheet.Range("A1:B1").SetValuesAsync([data.Columns.Cast<object?>().ToArray()]);
await sheet.Range("A2:B3").SetValuesAsync(data.Rows.Select(row => row.ToArray()).ToArray());
await sheet.Tables.AddAsync("RegionalSales", "A1:B3", new TableOptions { Style = "TableStyleMedium2", ShowRowStripes = true });
return await control.SaveAsync(StreamType.PDF);
}
Remarks
Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.