Skip to content

Commit de585f1

Browse files
author
arunsivakumarsf3927
committed
959853: Adding Documentation for the Fill series, GetData() and GetActiveWorksheet()
1 parent 2c9bd45 commit de585f1

3 files changed

Lines changed: 117 additions & 0 deletions

File tree

Document-Processing/Excel/Spreadsheet/Blazor/cell-range.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,48 @@ The `AutofillAsync()` method accepts string parameters in A1 notation for `fillR
100100
{% endhighlight %}
101101
{% endtabs %}
102102

103+
### Autofill options
104+
105+
The Spreadsheet provides multiple autofill behaviors that determine how adjacent cells are populated when using the fill handle :
106+
107+
- `CopyCells`
108+
- `FillSeries`
109+
- `FillFormattingOnly`
110+
- `FillWithoutFormatting`
111+
112+
113+
#### Copy Cells
114+
115+
Copies the selected cell content and formatting to the adjacent cells.
116+
117+
Can be done in the following way:
118+
119+
- Using the fill handle to select the adjacent cell range and choosing the "Copy Cells" option from the "AutoFillOptions" menu to fill the adjacent cells.
120+
121+
#### Fill Series
122+
123+
Fills a series of numbers, characters, or dates based on the selected cell content to the adjacent cells, including their formats.
124+
125+
Can be done in the following ways:
126+
127+
- Using the fill handle to select the adjacent cell range and choosing the "Fill Series" option from the "AutoFillOptions" menu to fill the adjacent cells.
128+
129+
#### Fill Formatting Only
130+
131+
Fills only the cell style and number formatting based on the selected cell content to the adjacent cells, without copying the content itself.
132+
133+
Can be done in the following way:
134+
135+
- Using the fill handle to select the adjacent cell range and choosing the "Fill Formatting Only" option in the "AutoFillOptions" menu to fill the adjacent cells.
136+
137+
#### Fill Without Formatting
138+
139+
Fills a series of numbers, characters, or dates based on the selected cells to the adjacent cells, without copying their formats.
140+
141+
Can be done in the following way:
142+
143+
- Using the fill handle to select the adjacent cell range and choosing the "Fill Without Formatting" option in the "AutoFillOptions" menu to fill the adjacent cells.
144+
103145
The following illustration demonstrates the use of autofill in the Spreadsheet component.
104146

105147
![Autofill Illustration](images/autofill.gif)
11.9 KB
Loading

Document-Processing/Excel/Spreadsheet/Blazor/worksheet.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,81 @@ This method inserts one or more sheets at a specified position in the workbook w
7171
{% endhighlight %}
7272
{% endtabs %}
7373

74+
75+
### Get active worksheet
76+
77+
Retrieves key properties of the [GetActiveWorksheet](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_GetActiveWorksheet_System_Nullable_System_Int32__System_Int32_:~:text=A1%22%2C%20%22New%20York%22), including name, index, row and column counts, the active cell, and the current selection. Returns null when no active worksheet is available.
78+
79+
{% tabs %}
80+
{% highlight razor %}
81+
82+
<button @onclick="GetActiveWorksheet">Get Active Worksheet</button>
83+
84+
<SfSpreadsheet @ref=SpreadsheetRef DataSource="DataSourceBytes">
85+
<SpreadsheetRibbon></SpreadsheetRibbon>
86+
</SfSpreadsheet>
87+
88+
@code {
89+
public byte[] DataSourceBytes { get; set; }
90+
public SfSpreadsheet SpreadsheetRef;
91+
92+
protected override void OnInitialized()
93+
{
94+
string filePath = "wwwroot/Sample.xlsx";
95+
DataSourceBytes = File.ReadAllBytes(filePath);
96+
}
97+
98+
public async Task GetActiveWorksheet()
99+
{
100+
// Get the active sheet snapshot
101+
var active = spreadsheet.GetActiveWorksheet();
102+
}
103+
}
104+
105+
{% endhighlight %}
106+
{% endtabs %}
107+
108+
### Get cell or range data
109+
110+
Retrieves key properties of the [GetData](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_GetActiveWorksheet_System_Nullable_System_Int32__System_Int32_:~:text=Selected%3A%20%7Bactive.SelectedRange%7D%22), for a single cell or a selected range and returns a map keyed by each cell's address. Each value is a `CellData` built from the corresponding worksheet cell, including value, number format, formatted display text (when a format is applied), wrap state, lock state, optional hyperlink, and computed style. Returns null when the provided address is null or whitespace.
111+
112+
Parameters
113+
114+
- `cellAddress` string: The cell or selected range to read. Supported forms:
115+
- Single cell (for example, "A1")
116+
- Selected range (for example, "A2:B5")
117+
- Sheet-qualified (for example, "Sheet1!A1" or "Sheet1!A2:B5")
118+
When a worksheet name is included, data is read from that worksheet; otherwise, the active worksheet is used.
119+
120+
{% tabs %}
121+
{% highlight razor %}
122+
123+
<button @onclick="GetData">Get Data</button>
124+
125+
<SfSpreadsheet @ref=SpreadsheetRef DataSource="DataSourceBytes">
126+
<SpreadsheetRibbon></SpreadsheetRibbon>
127+
</SfSpreadsheet>
128+
129+
@code {
130+
public byte[] DataSourceBytes { get; set; }
131+
public SfSpreadsheet SpreadsheetRef;
132+
133+
protected override void OnInitialized()
134+
{
135+
string filePath = "wwwroot/Sample.xlsx";
136+
DataSourceBytes = File.ReadAllBytes(filePath);
137+
}
138+
139+
public async Task GetActiveWorksheet()
140+
{
141+
// Get the active sheet snapshot
142+
var data = spreadsheet.GetData("Sheet2!D5:E6");
143+
}
144+
}
145+
146+
{% endhighlight %}
147+
{% endtabs %}
148+
74149
**Insert a single sheet with a user-defined name**
75150

76151
This method adds one sheet at a specific position with a user-defined name. Each call to this method adds only one sheet. Using meaningful names like "Budget" or "Inventory" makes the workbook easier to understand. If a negative index value is provided, the method will exit without adding any sheet.

0 commit comments

Comments
 (0)