diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index 0de2e163..eaa51f29 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -1789,19 +1789,92 @@
  • UWP
  • Windows Forms
  • WPF
  • diff --git a/Document-Processing/Excel/Spreadsheet/Conditional-Formatting.md b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting.md new file mode 100644 index 00000000..14f1348a --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting.md @@ -0,0 +1,162 @@ +--- +layout: post +title: Conditional Formatting in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Conditional Formatting support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Conditional Formatting in UWP Spreadsheet (SfSpreadsheet) + +This section explains about how to apply conditional formatting rules programmatically at run time in SfSpreadsheet. + +In SfSpreadsheet, to apply conditional format for a cell or range of cells, add `IConditionalFormat` to that range by using `AddCondition` method. + +{% tabs %} +{% highlight c# %} +var worksheet =spreadsheet.Workbook.Worksheets[0]; +IConditionalFormats condition = worksheet.Range["A1"].ConditionalFormats; +IConditionalFormat condition1 = condition.AddCondition(); +{% endhighlight %} +{% endtabs %} + +## Highlight Cell Rules + +### Based on CellValue + +To format the cells based on cell value, define the conditional format type as **CellValue** and other formatting options such as formula, operator, background color etc., to the specified cell or range. Finally, invalidate the cells to refresh the view. + +{% tabs %} +{% highlight c# %} +var worksheet = spreadsheet.Workbook.Worksheets[0]; +IConditionalFormats condition = worksheet.Range["A1:A100"].ConditionalFormats; +IConditionalFormat condition1 = condition.AddCondition(); + +condition1.FormatType = ExcelCFType.CellValue; +condition1.Operator = ExcelComparisonOperator.Greater; +condition1.FirstFormula = "10"; +condition1.BackColor = ExcelKnownColors.Light_orange; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Col(1)); +{% endhighlight %} +{% endtabs %} + +### Based on Formula or Cell References + +To format the cells based on Formula or Cell References, define the conditional format type as **Formula** and other formatting options such as formula, background color etc., to the specified cell or range. Finally, invalidate the cells to refresh the view. + +{% tabs %} +{% highlight c# %} +var worksheet = spreadsheet.Workbook.Worksheets[0]; +IConditionalFormats condition = worksheet.Range["A1:A100"].ConditionalFormats; +IConditionalFormat condition1 = condition.AddCondition(); + +condition1.FormatType = ExcelCFType.Formula; +condition1.FirstFormula = "=(B1+B2)>50"; +condition1.BackColor = ExcelKnownColors.Brown; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Col(1)); +{% endhighlight %} +{% endtabs %} + +### Based on SpecificText + +To format the cells based on specified text, define the conditional format type as **SpecificText** and other formatting options such as the particular text, operator, background color etc., to the specified cell or range. Finally, invalidate the cells to refresh the view. + +{% tabs %} +{% highlight c# %} +var worksheet = spreadsheet.Workbook.Worksheets[0]; +IConditionalFormats condition = worksheet.Range["A1:A100"].ConditionalFormats; +IConditionalFormat condition1 = condition.AddCondition(); + +condition1.FormatType = ExcelCFType.SpecificText; +condition1.Text = "SYNC"; +condition1.Operator = ExcelComparisonOperator.ContainsText; +condition1.BackColor = ExcelKnownColors.Light_orange; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Col(1)); +{% endhighlight %} +{% endtabs %} + +### Based on TimePeriod + +To format the cells based on time period, define the conditional format type as **TimePeriod** and other formatting options such as the time periods for the date, operator, background color etc., to the specified cell or range. Finally, invalidate the cells to refresh the view. + +{% tabs %} +{% highlight c# %} +var worksheet = spreadsheet.Workbook.Worksheets[0]; +IConditionalFormats condition = worksheet.Range["A1:A100"].ConditionalFormats; +IConditionalFormat condition1 = condition.AddCondition(); + +condition1.FormatType = ExcelCFType.TimePeriod; +condition1.TimePeriodType = CFTimePeriods.Today +condition1.BackColor = ExcelKnownColors.Light_orange; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Col(1)); +{% endhighlight %} +{% endtabs %} + +Sample Output + +![UWP SfSpreadsheet displays different colors applied as per the conditions ](Conditional-Formatting_images/Conditional-Formatting_img1.PNG) + +## Data Bars + +To apply the conditional format based on data bars,define the conditional format type as a **DataBar** and specify the properties associated with DataBars such as bar color, MinPoint, MaxPoint etc.,.to the specified cell or range. Finally, invalidate that cells to update the view. + +{% tabs %} +{% highlight c# %} +var worksheet = spreadsheet.Workbook.Worksheets[0]; +var conditionalFormats = worksheet.Range["B1:B100"].ConditionalFormats; +var conditionalFormat = conditionalFormats.AddCondition(); + +conditionalFormat.FormatType = ExcelCFType.DataBar; +conditionalFormat.DataBar.BarColor = Color.FromArgb(255, 214, 0, 123); +conditionalFormat.DataBar.MinPoint.Type = ConditionValueType.LowestValue; +conditionalFormat.DataBar.MaxPoint.Type = ConditionValueType.HighestValue; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Col(2)); +{% endhighlight %} +{% endtabs %} + +Sample Output + +![UWP SfSpreadsheet displays different colors applied in different columns based on conditions](Conditional-Formatting_images/Conditional-Formatting_img2.PNG) + +## Color Scales + +To apply the conditional format based on color scales, define the conditional format type as a **ColorScale** and specify the other properties associated with ColorScale such as condition count,color criteria etc.,to the specified cell or range. Finally,invalidate that cells to update the view. + +{% tabs %} +{% highlight c# %} +var worksheet = spreadsheet.Workbook.Worksheets[0]; +var conditionalFormats = worksheet.Range["C2:C100"].ConditionalFormats; +var conditionalFormat = conditionalFormats.AddCondition(); + +conditionalFormat.FormatType = ExcelCFType.ColorScale; +conditionalFormat.ColorScale.SetConditionCount(2); +conditionalFormat.ColorScale.Criteria[0].FormatColorRGB = Color.FromArgb(255, 99, 190, 123); +conditionalFormat.ColorScale.Criteria[1].FormatColorRGB = Color.FromArgb(255, 90, 138, 198); +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Col(3)); +{% endhighlight %} +{% endtabs %} + +Sample Output + +![UWP SfSpreadsheet displays colors changed as per the scales](Conditional-Formatting_images/Conditional-Formatting_img3.PNG) + +## Icon Sets + +To apply the conditional format for Icon sets, define the conditional format type as **IconSet** and the properties associated with IconSet such as the type of the icon,criteria etc., to the specified cell or range. Finally, invalidate that cells to update the view. + +{% tabs %} +{% highlight c# %} +var worksheet = spreadsheet.Workbook.Worksheets[0]; +var conditionalFormats = worksheet.Range["D2:D100"].ConditionalFormats; +var conditionalFormat = conditionalFormats.AddCondition(); + +conditionalFormat.FormatType = ExcelCFType.IconSet; +conditionalFormat.IconSet.IconSet = ExcelIconSetType.ThreeSymbols; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Col(4)); +{% endhighlight %} +{% endtabs %} + +Sample Output + +![UWP SfSpreadsheet displays the applied icons as per the applied conditions](Conditional-Formatting_images/Conditional-Formatting_img4.PNG) diff --git a/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img1.PNG b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img1.PNG new file mode 100644 index 00000000..eeea452a Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img1.PNG differ diff --git a/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img2.PNG b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img2.PNG new file mode 100644 index 00000000..1edb63b2 Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img2.PNG differ diff --git a/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img3.PNG b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img3.PNG new file mode 100644 index 00000000..3c0a3284 Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img3.PNG differ diff --git a/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img4.PNG b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img4.PNG new file mode 100644 index 00000000..14318070 Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/Conditional-Formatting_images/Conditional-Formatting_img4.PNG differ diff --git a/Document-Processing/Excel/Spreadsheet/Custom-Formula.md b/Document-Processing/Excel/Spreadsheet/Custom-Formula.md new file mode 100644 index 00000000..7e28bcd2 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Custom-Formula.md @@ -0,0 +1,47 @@ +--- +layout: post +title: Custom Formula in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Custom Formula support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Custom Formula in UWP Spreadsheet (SfSpreadsheet) + +SfSpreadsheet allows you to add custom formulas into its function library. You can add the custom formula into the SfSpreadsheet by using the `AddFunction` method of `FormulaEngine`, + +{% tabs %} +{% highlight c# %} + +spreadsheet.WorkbookLoaded += spreadsheet_WorkbookLoaded; + +void spreadsheet_WorkbookLoaded(object sender, WorkbookLoadedEventArgs args) +{ + + foreach (var grid in args.GridCollection) + AddCustomFormula(grid); + + //Computing the formula at runtime + var range = spreadsheetControl.ActiveSheet.Range["B2"]; + spreadsheetControl.ActiveGrid.SetCellValue(range,"=FindLength(Sample)"); +} + +private void AddCustomFormula(SpreadsheetGrid grid) +{ + + // Add a formula named FindLength to the Library. + grid.FormulaEngine.AddFunction("FindLength", new FormulaEngine.LibraryFunction(ComputeLength)); +} + +//Implementation of formula + +public string ComputeLength(string range) +{ + + //Used to calculate the length of the string + return range.Length.ToString(); +} + +{% endhighlight %} +{% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/Editing.md b/Document-Processing/Excel/Spreadsheet/Editing.md new file mode 100644 index 00000000..a04c5e93 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Editing.md @@ -0,0 +1,291 @@ +--- +layout: post +title: Editing in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Editing support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Editing in UWP Spreadsheet (SfSpreadsheet) + +This section explains about the Editing behavior, Data Validation and Hyperlinks in SfSpreadsheet. + +## Editing + +The SfSpreadsheet control provides support for editing, you can modify and commit the cell values in the workbook. + +By default, Editing will be enabled in `SfSpreadsheet`,but if you want to disable the editing in SfSpreadsheet, then set the `AllowEditing` Property to be false. + +{% tabs %} +{% highlight c# %} + +void spreadsheet_WorkbookLoaded(object sender, WorkbookLoadedEventArgs args) +{ + spreadsheet.ActiveGrid.AllowEditing = false; +} + +{% endhighlight %} +{% endtabs %} + +### Editing a cell programmatically + +#### Start Editing + +User can edit a cell programmatically by using `BeginEdit` method. + +{% tabs %} +{% highlight c# %} + + spreadsheet.ActiveGrid.CurrentCell.BeginEdit(true); + +{% endhighlight %} +{% endtabs %} + +#### End Editing + +User can end the editing of a cell programmatically in any of the following way, + +* `ValidateAndEndEdit` - Validates and ends the edit operation for the current cell. if the cancel is "true", then the current cell remains in edit mode else if the validation is true, commits the new value and moved to next cell or else if the validation is false, it reverts the old value and moved to next cell. + +* `EndEdit` - Commits and ends the edit operation for the current cell, if it is passed with parameter _"true"_, commits the new changes for the cell, else reverts the old value. + +{% tabs %} +{% highlight c# %} + +//Validates and end the edit operation, +spreadsheet.ActiveGrid.CurrentCell.ValidateAndEndEdit(); + +//Commits the value and end the edit operation, +spreadsheet.ActiveGrid.CurrentCell.EndEdit(true); + +{% endhighlight %} +{% endtabs %} + +### Locking or Unlocking a cell + +Locking cells allows you to disable editing and formatting the cells when the sheet is protected. By default, every cells are locked in the worksheet. +But while in protect mode, if you want to edit or format a cell, you can unlock the cells. + +{% tabs %} +{% highlight c# %} + +var worksheet = spreadsheet.ActiveSheet; +var excelStyle = worksheet.Range["A2"].CellStyle; + +//To unlock a cell, +excelStyle.Locked = false; + +//To lock a cell, +excelStyle.Locked = true; + +{% endhighlight %} +{% endtabs %} + +### Properties, Methods and Events + +The order of events when editing and committing a cell value in SfSpreadsheet, + + + + + + + + + + + + + + +
    +Events +Description
    +CurrentCellBeginEdit +Occurs when the current cell enters into edit mode. This event allows to cancel entering the edit mode.
    +CurrentCellValueChanged +Occurs when the current cell value is changed in edit mode.
    +CurrentCellValidating +Occurs when the current cell value is going to be validated. It allows you to validate and cancel the end editing.
    +CurrentCellValidated +Occurs after the current cell is validated.
    +CurrentCellEndEdit +Occurs when the current cell leaves from edit mode.
    + +Below table list the properties associated with Editing. + + + + + + + + + + + + +
    +Properties +Description
    +AllowEditing +Gets or sets the value indicating whether to allow the editing operation or not.
    +EditorSelectionBehavior +Gets or sets a value indicating whether editor select all the value or move last position.
    +EditTrigger +Gets or sets a value indicating any of the trigger options will cause cells to enter Edit Mode.
    +IsEditing +Gets whether the current cell is in edit mode or not.
    + +Below table list the methods associated with Editing. + + + + + + + + + + + + +
    +Methods +Description
    +BeginEdit +Begins the editing operation of the current cell and returns true if the current cell enters into edit mode.
    +EndEdit +Commits and ends the edit operation of the current cell.
    +ValidateAndEndEdit +Validates and ends the edit operation of the current cell.
    +Validate +Validates the current cell in the SpreadsheetGrid.
    + +## Data Validation + +Data Validation is a list of rules to limit the type of data or the values that can be entered in the cell. + +### Applying Data Validation at runtime + +SfSpreadsheet allows the user to apply the data validation rules at runtime for particular cell or range using `IDataValidation` interface. + +{% tabs %} +{% highlight c# %} + +//Number Validation +IDataValidation validation = spreadsheet.ActiveSheet.Range["A5"].DataValidation; + +validation.AllowType = ExcelDataType.Integer; +validation.CompareOperator = ExcelDataValidationComparisonOperator.Between; +validation.FirstFormula = "4"; +validation.SecondFormula = "15"; +validation.ShowErrorBox = true; +validation.ErrorBoxText = "Accepts values only between 4 to 15"; + + +//Date Validation +IDataValidation validation = spreadsheet.ActiveSheet.Range["B4"].DataValidation; + +validation.AllowType = ExcelDataType.Date; +validation.CompareOperator = ExcelDataValidationComparisonOperator.Greater; +validation.FirstDateTime = new DateTime(2016,5,5); +validation.ShowErrorBox = true; +validation.ErrorBoxText = "Enter the date value which is greater than 05/05/2016"; + +//TextLength Validation +IDataValidation validation = spreadsheet.ActiveSheet.Range["A3:B3"].DataValidation; + +validation.AllowType = ExcelDataType.TextLength; +validation.CompareOperator = ExcelDataValidationComparisonOperator.LessOrEqual; +validation.FirstFormula = "4"; +validation.ShowErrorBox = true; +validation.ErrorBoxText = "Text length should be lesser than or equal 4 characters"; + +//List Validation +IDataValidation validation = spreadsheet.ActiveSheet.Range["D4"].DataValidation; + +validation.ListOfValues = new string[] { "10", "20", "30" }; + +//Custom Validation +IDataValidation validation = spreadsheet.ActiveSheet.Range["D4"].DataValidation; + +validation.AllowType = ExcelDataType.Formula; +validation.FirstFormula = "=A1+A2>0"; +validation.ErrorBoxText = "Sum of the values in A1 and A2 should be greater than zero"; + +{% endhighlight %} +{% endtabs %} + +For more reference, please go through the [XlsIO](http://help.syncfusion.com/file-formats/xlsio/working-with-data-validation) UG. + +T> If you want to load ComboBox to a cell in SfSpreadsheet, you can apply List Validation to that cell. + +## Hyperlink + +The Hyperlink is a convenient way to access the web pages, files and browse the data within a worksheet or other worksheets in a workbook. SfSpreadsheet provides support to add, edit and remove the Hyperlinks in the workbook. + +### Add a Hyperlink to a cell + +SfSpreadsheet provides support to add hyperlink to a cell and it can be added in the hyperlinks collection using `IHyperlinks` interface. + +SfSpreadsheet allows you to add below types of the hyperlink. + +* Web URL +* Cell or range in workbook +* E-mail +* External files + +{% tabs %} +{% highlight c# %} + +// Creating a Hyperlink for e-mail, +var range = spreadsheet.ActiveSheet.Range["A5"]; + +IHyperLink hyperlink1 = spreadsheet.ActiveSheet.HyperLinks.Add(range); +hyperlink1.Type = ExcelHyperLinkType.Url; +hyperlink1.Address = "mailto:Username@syncfusion.com"; +hyperlink1.TextToDisplay="Send Mail"; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Cell(5, 1)); + +// Creating a Hyperlink for Opening Files, +var range1 = spreadsheet.ActiveSheet.Range["D5"]; + +IHyperLink hyperlink2 = spreadsheet.ActiveSheet.HyperLinks.Add(range1); +hyperlink2.Type = ExcelHyperLinkType.File; +hyperlink2.Address = @"C:\Samples\Local"; +hyperlink2.TextToDisplay = "File Location"; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Cell(5, 4)); + +//Creating a Hyperlink to refer another cell in the workbook, +var range2 = spreadsheet.ActiveSheet.Range["C13"]; + +IHyperLink hyperlink3 = spreadsheet.ActiveSheet.HyperLinks.Add(range); +hyperlink3.Type = ExcelHyperLinkType.Workbook; +hyperlink3.Address = "Sheet2!C23"; +hyperlink3.TextToDisplay = "Sample"; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Cell(13, 3)); + +{% endhighlight %} +{% endtabs %} + +### Edit or Remove a Hyperlink + +SfSpreadsheet provides support to edit or remove the hyperlinks from the range by accessing Hyperlinks collection. + +{% tabs %} +{% highlight c# %} + +//To Edit a hyperlink in a cell, +var hyperlink = spreadsheet.ActiveSheet.Range["A5"].Hyperlinks[0]; +hyperlink.TextToDisplay = "Sample"; +hyperlink.Address = "http://help.syncfusion.com"; +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Cell(5,1)); + +//To remove a hyperlink in a cell, +var hyperlink = spreadsheet.ActiveSheet.Range["A5"].Hyperlinks.RemoveAt(0); +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Cell(5,1)); + +{% endhighlight %} +{% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/Find-and-Replace.md b/Document-Processing/Excel/Spreadsheet/Find-and-Replace.md new file mode 100644 index 00000000..70a4437b --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Find-and-Replace.md @@ -0,0 +1,202 @@ +--- +layout: post +title: Find and Replace in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Find and Replace support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Find and Replace in UWP Spreadsheet (SfSpreadsheet) + +This section explains about Find and Replace operations in SfSpreadsheet. + +## Find + +Searches for specific data such as particular number or text according to specified options and returns an IRange representing the cell or null if no cell is found. The various options in Find operation are + +* `FindAll` +* `FindNext` +* `FindConditionalFormatting` +* `FindConstants` +* `FindFormulas` +* `FindDataValidation` + +The common parameters to be passed in Find functions are, + +* The option to specify whether the search can be done within the Workbook(`IWorkbook`) or Worksheet(`IWorksheet`). +* The text to be searched. +* The option to specify the direction whether the search can be done either by row wise or column wise using `SearchBy` enum. +* The type to specify whether the search can be done either in formulas or values using `ExcelFindType` enum. +* For a case sensitive search, pass the parameter as true otherwise you can pass the parameter as false. +* For matching the entire cell content with the search text, pass the parameter as true otherwise you can pass the parameter as false. + +### Find All + +Searches every occurrence of specific data based on the criteria that you are searching for and returns an `IRange` list representing the cells in `SfSpreadsheet` + +{% tabs %} +{% highlight c# %} + +//Search the entire workbook +var list = spreadsheet.SearchManager.FindAll(spreadsheet.Workbook, "sample", SearchBy.ByRows, ExcelFindType.Text, false, true); + +// To select the matched cell content ranges, + +foreach (var cell in list) +{ + spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Cell(cell.Row, cell.Column)); +} + +//Search the particular worksheet +var list = spreadsheet.SearchManager.FindAll(spreadsheet.Workbook.Worksheets[0], "sample", SearchBy.ByRows, ExcelFindType.Text, false, true); + +// To select the matched cell content ranges, + +foreach (var cell in list) +{ + spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Cell(cell.Row, cell.Column)); +} + +{% endhighlight %} +{% endtabs %} + +### Find Next + +Searches the first occurrence of specific data which matches the conditions and returns the matched `IRange` from the current range that represents the cell. + +{% tabs %} +{% highlight c# %} + +//Search the text in entire workbook in column wise, +var cell = spreadsheet.SearchManager.FindNext(spreadsheet.Workbook, "sample", SearchBy.ByColumns, ExcelFindType.Text, false, true); + +// To move the current cell to matched cell content range, +spreadsheet.ActiveGrid.CurrentCell.MoveCurrentCell(cell.Row,cell.Column); + +//Search the formula in particular worksheet in row wise, +var cell = spreadsheet.SearchManager.FindNext(spreadsheet.Workbook.Worksheets[0], "sum", SearchBy.ByRows, ExcelFindType.Text, false, false); + +// To move the current cell to matched cell content range, +spreadsheet.ActiveGrid.CurrentCell.MoveCurrentCell(cell.Row,cell.Column); + +{% endhighlight %} +{% endtabs %} + +### Find Conditional Formatting + +Searches and returns the `IRange` list which have conditional formatting within the specified worksheet. + +{% tabs %} +{% highlight c# %} + +//Searches the conditional formatting within the worksheet, +var list = spreadsheet.SearchManager.FindConditionalFormatting(spreadsheet.Workbook.Worksheets[0]); + +// To select the matched cell content ranges, + +foreach (var cell in list) +{ + spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Cell(cell.Row, cell.Column)); +} + +{% endhighlight %} +{% endtabs %} + +### Find Constants + +Searches and returns the `IRange` list which have constants within the specified worksheet. + +{% tabs %} +{% highlight c# %} + +//Searches the constants within the worksheet, +var list = spreadsheet.SearchManager.FindConstants(spreadsheet.Workbook.Worksheets[0]); + +// To select the matched cell content ranges, + +foreach (var cell in list) +{ + spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Cell(cell.Row, cell.Column)); +} + +{% endhighlight %} +{% endtabs %} + +### Find Formulas + +Searches and returns the `IRange` list which have formulas within the specified worksheet. + +{% tabs %} +{% highlight c# %} + +//Searches the formulas within the worksheet, +var list = spreadsheet.SearchManager.FindFormulas(spreadsheet.Workbook.Worksheets[0]); + +// To select the matched cell content ranges, + +foreach (var cell in list) +{ + spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Cell(cell.Row, cell.Column)); +} + +{% endhighlight %} +{% endtabs %} + +### Find Data Validation + +Searches and returns the `IRange` list which have data validation within the specified worksheet. + +{% tabs %} +{% highlight c# %} + +//Searches the data validation within the worksheet, +var list = spreadsheet.SearchManager.FindDataValidation(spreadsheet.Workbook.Worksheets[0]); + +// To select the matched cell content ranges, + +foreach (var cell in list) +{ + spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Cell(cell.Row, cell.Column)); +} + +{% endhighlight %} +{% endtabs %} + +## Replace All + +Searches and replaces all the texts either in the workbook or worksheet based on the given option. + +The parameters to be passed in `ReplaceAll` function is, + +* The option to specify whether the search can be done within the Workbook(`IWorkbook`) or Worksheet(`IWorksheet`) in SfSpreadsheet. +* The text to be searched. +* The text to be replaced. +* For a case sensitive search, pass the parameter as true otherwise you can pass the parameter as false. +* For matching the entire cell content with the search text, pass the parameter as true otherwise you can pass the parameter as false. + +{% tabs %} +{% highlight c# %} + +//Replaces the text in the entire workbook +spreadsheet.SearchManager.ReplaceAll(spreadsheet.Workbook, "sample","Sync", false, false); + +//Replaces the text in the particular worksheet +spreadsheet.SearchManager.ReplaceAll(spreadsheet.Workbook.Worksheets[0], "sample", "sync", false, true); + +{% endhighlight %} +{% endtabs %} + +## Replace + +Searches for the text or numbers that you want to change using `FindNext` method and once the immediate matched cell has been found, use `SetCellValue` method to replace it with specified text or numbers in `SfSpreadsheet`. + +{% tabs %} +{% highlight c# %} + +//Searches the given text and replaces it with specified text +var cell = spreadsheet.SearchManager.FindNext(spreadsheet.Workbook, "sample", SearchBy.ByColumns, ExcelFindType.Text, false, true); +spreadsheet.ActiveGrid.SetCellValue(cell, "sync"); + +{% endhighlight %} +{% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/Formatting.md b/Document-Processing/Excel/Spreadsheet/Formatting.md new file mode 100644 index 00000000..1526cda5 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Formatting.md @@ -0,0 +1,324 @@ +--- +layout: post +title: Formatting in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Formatting support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Formatting in UWP Spreadsheet (SfSpreadsheet) + +This section explains about the formatting options similar to excel in SfSpreadsheet. + +Styles and formats defined in an Excel file are automatically imported. Users can also apply these settings to cells during run time. The following are the formatting attributes for the cell. + +* Cell font settings (font name, size, color, style, etc.) +* Cell background +* Cell content alignment (vertical and horizontal alignment, indent and text wrapping) +* Cell borders +* Number Formatting +* Merge Cells +* Built-in Styles +* Table Formats + +## Cell Background + +For applying background color for the cells at runtime in SfSpreadsheet, set the color index for the particular XlsIO range and invalidate the range in order to update the view in `SpreadsheetGrid`. + +For single cell + +{% tabs %} +{% highlight c# %} + +IRange range = spreadsheet.ActiveSheet.Range["A5"]; +range.CellStyle.ColorIndex = Syncfusion.XlsIO.ExcelKnownColors.Blue; +spreadsheet.ActiveGrid.InvalidateCell(range.Row, range.Column); + +{% endhighlight %} +{% endtabs %} + +For selected range of cells, + +{% tabs %} +{% highlight c# %} + +var selectedRanges = spreadsheet.ActiveGrid.SelectedRanges; + +foreach (var range in selectedRanges) +{ + string cell = GridExcelHelper.ConvertGridRangeToExcelRange(range, spreadsheet.ActiveGrid); + spreadsheet.ActiveSheet.Range[cell].CellStyle.ColorIndex = ExcelKnownColors.Blue; + spreadsheet.ActiveGrid.InvalidateCell(range, true); +} + +{% endhighlight %} +{% endtabs %} + +## Font + +SfSpreadsheet allows the user to apply the font settings such as font color, font name ,font size etc., for a particular cell or a range of cells. + +{% tabs %} +{% highlight c# %} + +IRange range = spreadsheet.Workbook.Worksheets[0].Range["A1:B5"]; +var gridRange = GridExcelHelper.ConvertExcelRangeToGridRange(range); + +//Setting the Font Family Name, +range.CellStyle.Font.FontName = "Arial Black"; + +//Setting the Font Styles, +range.CellStyle.Font.Bold = true; +range.CellStyle.Font.Italic = true; + +//Setting the Font Size, +range.CellStyle.Font.Size = 18; + +//Setting the Font Effects, +range.CellStyle.Font.Strikethrough = true; + +//Setting the UnderLine Types, +range.CellStyle.Font.Underline = ExcelUnderline.Single; + +//Setting the Font Color, +range.CellStyle.Font.Color = ExcelKnownColors.Blue; + +//Invalidating the range, to update in view, +spreadsheet.ActiveGrid.InvalidateCell(gridRange, true); + +{% endhighlight %} +{% endtabs %} + +## Cell Borders + +SfSpreadsheet allows the user to apply the borders at runtime for particular cell or range of cells, + +{% tabs %} +{% highlight c# %} + +//For a single cell, +IRange range = spreadsheet.Workbook.Worksheets[0].Range["A5"]; +range.Borders.LineStyle = ExcelLineStyle.Dash_dot; +range.Borders.Color = ExcelKnownColors.Gold; +spreadsheet.ActiveGrid.InvalidateCell(range.Row, range.Column); + +//For a range of cells, +IRange excelRange = spreadsheet.Workbook.Worksheets[0].Range["C3:D8"]; +excelRange.BorderAround(ExcelLineStyle.Double, ExcelKnownColors.Green); +excelRange.BorderInside(ExcelLineStyle.Dotted, ExcelKnownColors.Tan); +var gridRange = GridExcelHelper.ConvertExcelRangeToGridRange(excelRange); +spreadsheet.ActiveGrid.InvalidateCell(gridRange, true); + +{% endhighlight %} +{% endtabs %} + +## Cell Alignment + +SfSpreadsheet allows the user to align the content of the cell. The alignment options includes Horizontal Alignment, Vertical Alignment, Indentation, Orientation etc., + +{% tabs %} +{% highlight c# %} + +//Applying Horizontal Alignment for the cell "A2", +spreadsheet.Workbook.Worksheets[0].Range["A2"].CellStyle.HorizontalAlignment = ExcelHAlign.HAlignCenter; +spreadsheet.ActiveGrid.InvalidateCell(2,1); + +//Applying Vertical Alignment for the cell "B2", +spreadsheet.Workbook.Worksheets[0].Range["B2"].CellStyle.VerticalAlignment = ExcelVAlign.VAlignBottom; +spreadsheet.ActiveGrid.InvalidateCell(2,2); + +//Applying Orientation for the selected cell or ranges, +spreadsheet.FormatOrientation(90); + +//For Indentation, + +//Increase the indent for the selected ranges or cell, +spreadsheet.FormatIndent(true); + +//Decrease the indent for the selected ranges or cell, +spreadsheet.FormatIndent(false); + +//Level of indent for selected ranges or cell, +spreadsheet.FormatIndentLevel(3); + +{% endhighlight %} +{% endtabs %} + +## Wrap Text + +SfSpreadsheet allows the user to wrap the text in the cell, if the text is too large. + +{% tabs %} +{% highlight c# %} + +spreadsheet.ActiveSheet.Range["C4"].Text = "Wrapping the content in the cell"; +spreadsheet.ActiveSheet.Range["C4"].WrapText = true; +spreadsheet.ActiveSheet.AutofitRow(4); +spreadsheet.ActiveGrid.SetRowHeight(4, 4, spreadsheet.ActiveSheet.GetRowHeightInPixels(4)); +spreadsheet.ActiveGrid.InvalidateCell(4, 3); + +{% endhighlight %} +{% endtabs %} + +## Merge Cells + +### Merge + +SfSpreadsheet provides support to merge two or more cells. When a group of cells is merged, the contents of the upper-left cell will be taken as the content of the merged cell, rest will be deleted. + +For merging the cells in SfSpreadsheet, you need to add the `CoveredCellInfo` into `CoveredCells` collection of SpreadsheetGrid and merge the range using `Merge` method in XlsIO. Also to update the view, you need to invalidate the cells in the SpreadsheetGrid + +{% tabs %} +{% highlight c# %} + +var gridRange = spreadsheet.ActiveGrid.SelectedRanges.ActiveRange; +var excelRange = gridRange.ConvertGridRangeToExcelRange(spreadsheet.ActiveGrid); +var coverCell = new CoveredCellInfo(gridRange.Top, gridRange.Left, gridRange.Bottom, gridRange.Right); + +spreadsheet.ActiveGrid.CoveredCells.Add(coverCell); +spreadsheet.ActiveSheet.Range[excelRange].Merge(); +spreadsheet.ActiveGrid.InvalidateCell(gridRange, true); + +{% endhighlight %} +{% endtabs %} + +### Unmerge + +You can also unmerge the merged cells in SfSpreadsheet. + +For unmerging the cells in SfSpreadsheet, you need to clear the `CoveredCells` from the SpreadsheetGrid and unmerge the range using `UnMerge` method in XlsIO. Also to update the view, you need to invalidate the cells in the SpreadsheetGrid + +{% tabs %} +{% highlight c# %} + +var gridRange = spreadsheet.ActiveGrid.SelectedRanges.ActiveRange; +var excelRange = gridRange.ConvertGridRangeToExcelRange(spreadsheet.ActiveGrid); + +spreadsheet.ActiveGrid.CoveredCells.Clear(gridRange); +spreadsheet.ActiveSheet.Range[excelRange].UnMerge(); +spreadsheet.ActiveGrid.InvalidateCell(gridRange, true); + +{% endhighlight %} +{% endtabs %} + +## Number Format + +SfSpreadsheet allows the user to view the numbers in the cells with different formats which includes currency, percentage, datetime, scientific etc., + +{% tabs %} +{% highlight c# %} + +//Applying Percentage format for the selected ranges at runtime, +spreadsheet.Workbook.ActiveSheet.Range["C3"].NumberFormat = "0.00%"; +spreadsheet.ActiveGrid.InvalidateCell(3,3); + +//Applying Date format for the selected ranges at runtime, +spreadsheet.Workbook.ActiveSheet.Range["D1"].NumberFormat = "m/d/yyyy"; +spreadsheet.ActiveGrid.InvalidateCell(1,4); + +//Applying Time format for the selected ranges at runtime, +spreadsheet.Workbook.ActiveSheet.Range["D4"].NumberFormat = "[$-F400]h:mm:ss AM/PM"; +spreadsheet.ActiveGrid.InvalidateCell(3,4); + +{% endhighlight %} +{% endtabs %} + +The different types of number formats with its notation are + + + + + + + + + + + + + + + + + + + + + + + + +
    +Formats +Notation
    General + +General
    Number + +0.00
    Currency + +$* #,##0.00
    Accounting + +$* (#,##0.00);$* -??;@
    Short Date + +m/d/yyyy
    Long Date + +[$-F800]dddd, mmmm dd, yyyy
    Time + + [$-F400]h:mm:ss AM/PM
    Percentage + +0.00%
    Fraction + + #?/?
    Scientific + +0.00E+00
    + +## Built-in Styles + +SfSpreadsheet supports some predefined built in styles of XlsIO. `BuiltInStyles` is an enum which contains different styles for formatting a cell or range of cells. + +{% tabs %} +{% highlight c# %} + +spreadsheet.Workbook.ActiveSheet.Range["A3"].BuiltInStyle = BuiltInStyles.Heading2; +spreadsheet.ActiveGrid.InvalidateCell(3, 1); + +{% endhighlight %} +{% endtabs %} + +## Format as Table + +SfSpreadsheet allows the users to format a table with built in styles of table (i.e.) `TableBuiltInStyles` of XlsIO + +{% tabs %} +{% highlight c# %} + +// Creating a table +IListObject table = spreadsheet.Workbook.ActiveSheet.ListObjects.Create("Table1", spreadsheet.Workbook.ActiveSheet.Range["C1:G5"]); + +// Formatting table with a built-in style +table.BuiltInTableStyle = TableBuiltInStyles.TableStyleLight6; +spreadsheet.ActiveGrid.InvalidateCells(); + +{% endhighlight %} +{% endtabs %} + +For more information regarding formatting options, please go through [XlsIO](http://help.syncfusion.com/file-formats/xlsio/working-with-cell-or-range-formatting) + +N> Users need to [refresh the view](http://help.syncfusion.com/uwp/sfspreadsheet/working-with-sfspreadsheet#refreshing-the-view) after the formatting is applied on the XlsIO range to update the styles in `SpreadsheetGrid`. + +## Clear formatting + +SfSpreadsheet provides support to clear the contents of a cell along with its formatting or by specifying the required clear options using [ExcelClearOptions](http://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.ExcelClearOptions.html) enum which specifies the possible directions to clear the cell formats, content, comments,conditional format,data validation or clear all of them. + +{% tabs %} +{% highlight c# %} + +//To clear the contents along with its formatting in the range, +spreadsheet.Workbook.Worksheets[0].Range[4, 5].Clear(true); + +//To clear the range with specified ExcelClearOptions, +spreadsheet.Workbook.Worksheets[0].Range[4, 5].Clear(ExcelClearOptions.ClearConditionalFormats); + +{% endhighlight %} +{% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/Formulas.md b/Document-Processing/Excel/Spreadsheet/Formulas.md new file mode 100644 index 00000000..04c99284 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Formulas.md @@ -0,0 +1,1671 @@ +--- +layout: post +title: Formulas in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Formulas support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Formulas in UWP Spreadsheet (SfSpreadsheet) + +SfSpreadsheet calculation engine offers automated calculation over a formula, expression, or cross sheet references. SfSpreadsheet calculation engine is preloaded with 409 formulas covering a broad range of business functions. + +## Adding Formula into cell + +To add formulas into a cell programmatically, use `SetCellValue` method of `SpreadsheetGrid` should be invoked and then invalidate that cell to update the view. + +{% tabs %} +{% highlight c# %} + +var range = spreadsheet.ActiveSheet.Range["A2"]; +spreadsheet.ActiveGrid.SetCellValue(range, "=SUM(B1:B2)"); +spreadsheet.ActiveGrid.InvalidateCell(2,1); + +{% endhighlight %} +{% endtabs %} + +## Named Ranges + +Named Ranges are the defined names that represents a cell, range of cells, formula, or constant value or table. Each name have a scope of either to a specific worksheet or to the entire workbook. + +### Define named ranges at runtime + +SfSpreadsheet allows the user to define/add the named ranges at runtime by using `AddNamedRange` method. + +{% tabs %} +{% highlight c# %} + +spreadsheet.AddNamedRange("SampleName", "A3:B3", "Sheet1"); + +{% endhighlight %} +{% endtabs %} + +### Edit or remove named ranges at runtime + +SfSpreadsheet allows the user to edit the named ranges at runtime by `EditNamedRange` method and remove the named ranges at runtime by `DeleteNamedRange` method + +{% tabs %} +{% highlight c# %} + +//To Edit the named ranges, +IName name = spreadsheet.Workbook.Names["Sample"]; +spreadsheet.EditNamedRange("Test", "A3:B3", name); + +//To remove the named ranges, +IName name = spreadsheet.Workbook.Names["Sample"]; +spreadsheet.DeleteNamedRange(name); + +{% endhighlight %} +{% endtabs %} + +## Supported functions + +Following is a list of functions that are supported by SfSpreadsheet + +### Database Functions + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +DCOUNT

    +Returns the number of cells containing numbers in a field of a list or database that satisfy specified conditions

    +DCOUNTA

    +Returns the number of non-blank cells in a field of a list or database, that satisfy specified conditions

    +DAVERAGE

    +Calculates the average of values in a field of a list or database, that satisfy specified conditions

    +DGET

    +Returns a single value from a field of a list or database, that satisfy specified conditions

    +DMAX

    +Returns the maximum value from a field of a list or database, that satisfy specified conditions

    +DMIN

    +Returns the minimum value from a field of a list or database, that satisfy specified conditions

    +DSTDEVP

    +Calculates the standard deviation (based on an entire population) of values in a field of a list or database, that satisfy specified conditions

    +DSTEV

    +Calculates the standard deviation (based on a sample of a population) of values in a field of a list or database, that satisfy specified conditions

    +DVARP

    +Calculates the variance (based on an entire population) of values in a field of a list or database, that satisfy specified conditions

    +DVAR

    +Calculates the variance (based on a sample of a population) of values in a field of a list or database, that satisfy specified conditions

    + +### Date and Time Functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +DATE

    +Returns a date, from a user-supplied year, month and day

    +DATEVALUE

    +Converts a text string showing a date, to an integer that represents the date in Excel's date-time code

    +DAY

    +Returns the day (of the month) from a user-supplied date

    +DAYS360

    +Calculates the number of days between 2 dates, based on a 360-day year (12 x 30 months)

    +HOUR

    +Returns the hour part of a user-supplied time

    +MINUTE

    +Returns the minute part of a user-supplied time

    +SECOND

    +Returns the seconds part of a user-supplied time

    +MONTH

    +Returns the month from a user-supplied date

    +NOW

    +Returns the current date & time

    +TIME

    +Returns a time, from a user-supplied hour, minute and second

    +TIMEVALUE

    +Converts a text string showing a time, to a decimal that represents the time in Excel

    +TODAY

    +Returns today's date

    +WEEKDAY

    +Returns an integer representing the day of the week for a supplied date

    +YEAR

    +Returns the year from a user-supplied date

    +DAYS

    +Calculates the number of days between 2 dates

    +EDATE

    +Returns a date that is the specified number of months before or after an initial supplied start date

    +EOMONTH

    +Returns a date that is the last day of the month which is a specified number of months before or after an initial supplied start date

    +ISOWEEKNUM

    +Returns the ISO week number of the year for a given date

    +NETWORKDAYS.INTL

    +Returns the number of whole network days (excluding weekends & holidays), between two supplied dates, using parameters to specify weekend days 

    +WEEKNUM

    +Returns an integer representing the week number (from 1 to 53) of the year from a user-supplied date

    +WORKDAY

    +Returns a date that is a supplied number of working days (excluding weekends & holidays) ahead of a given start date

    +WORKDAY.INTL

    +Returns a date that is a supplied number of working days (excluding weekends & holidays) ahead of a given start date, using supplied parameters to specify weekend days

    +YEARFRAC

    +Calculates the fraction of the year represented by the number of whole days between two dates

    + +### Engineering Functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +DEC2BIN

    +Converts a decimal number to binary

    +DCE2OCT

    +Converts a binary number to octal

    +DEC2HEX

    +Converts a decimal number to hexadecimal

    +BIN2DEC

    +Converts a binary number to hexadecimal

    +BIN2OCT

    +Converts a binary number to octal

    +BIN2HEX

    +Converts a binary number to hexadecimal

    +HEX2BIN

    +Converts a hexadecimal number to binary

    +HEX2DEC

    +Converts a hexadecimal number to a decimal

    +HEX2OCT

    +Converts a hexadecimal number to octal

    +OCT2BIN

    +Converts octal number to binary

    +OCT2DEC

    +Converts octal number to a decimal

    +OCT2HEX

    +Converts octal number to hexadecimal

    +IMABS

    +Returns the absolute value (the modulus) of a complex number

    +IMAGINARY

    +Returns the imaginary coefficient of a complex number

    +IMREAL

    +Returns the real coefficient of a complex number

    +COMPLEX

    +Converts user-supplied real and imaginary coefficients into a complex number

    +IMSUM

    +Calculates the sum of two complex numbers

    +IMSUB

    +Subtracts two complex numbers

    +IMPRODUCT

    +Returns the product of up to 255 supplied complex numbers

    +IMDIV

    +Returns the quotient of two supplied complex numbers

    +IMCONJUGATE

    +Returns the complex conjugate of a complex number

    +IMSQRT

    +Returns the square root of a complex number

    +IMARGUMENT

    +Returns the argument Θ (an angle expressed in radians) of a complex number

    +IMSIN

    +Returns the sine of a complex number

    +IMCSC

    +Returns the cosecant of a complex number

    +IMCOS

    +Returns the cosine of a complex number

    +IMSEC

    +Returns the secant of a complex number

    +IMTAN

    +Returns the tangent of a complex number

    +IMCOT

    +Returns the cotangent of a complex number

    +IMSINH

    +Returns the hyperbolic sine of a complex number

    +IMCSCH

    +Returns the hyperbolic cosecant of a complex number

    +IMCOSH

    +Returns the hyperbolic cosine of a complex number

    +IMSECH

    +Returns the hyperbolic secant of a complex number 

    +IMLOG10

    +Returns the base-10 logarithm of a complex number

    +IMLOG2

    +Returns the base-2 logarithm of a complex number

    +IMLN

    +Returns the natural logarithm of a complex number

    +IMEXP

    +Returns the exponential of a complex number

    +IMPOWER

    +Calculates a complex number raised to a supplied power

    +GESTEP

    +Tests whether a number is greater than a supplied threshold value

    +DELTA

    +Tests whether two supplied numbers are equal

    +BITAND

    +Returns a Bitwise 'And' of two numbers

    +BITOR

    +Returns a Bitwise 'Or' of two numbers

    +BITXOR

    +Returns a Bitwise 'Exclusive Or' of two numbers

    +BITLSHIFT

    +Returns a number shifted left by a specified number of bits 

    +BITRSHIFT

    +Returns a number shifted right by a specified number of bits

    +ERF

    +Returns the error function integrated between two supplied limits

    +ERF.PRECISE

    +Returns the error function integrated between 0 and a supplied limit

    +ERFC.PRECISE

    +Returns the complementary error function integrated between a supplied lower limit and infinity

    +BESSELI

    +Calculates the modified Bessel function In(x)

    +BESSELJ

    +Calculates the Bessel function Jn(x)

    +BESSELY

    +Calculates the modified Bessel function Yn(x)

    +BESSELK

    +Calculates the modified Bessel function Kn(x)

    +CONVERT

    +Converts a number from one measurement system to another

    + +### Financial Functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +DB

    +Calculates the depreciation of an asset for a specified period, using the fixed-declining balance method

    +DDB

    +Calculates the depreciation of an asset for a specified period, using the double-declining balance method, or some other user-specified method

    +FV

    +Calculates the future value of an investment with periodic constant payments and a constant interest rate

    +IPMT

    +Calculates the interest payment for a given period of an investment, with periodic constant payments and a constant interest rate

    +IRR

    +Calculates the internal rate of return for a series of cash flows

    +XIRR

    +Calculates the internal rate of return for a schedule of cash flows

    +ISPMT

    +Returns the interest paid during a specified period of an investment

    +MIRR

    +Calculates the internal rate of return for a series of periodic cash flows, considering the cost of the investment and the interest on the reinvestment of cash

    +NPER

    +Returns the number of periods for an investment with periodic constant payments and a constant interest rate

    +NPV

    +Calculates the net present value of an investment, based on a supplied discount rate, and a series of future payments and income

    +PMT

    +Calculates the payments required to reduce a loan, from a supplied present value to a specified future value

    +PPMT

    +Calculates the payment on the principal for a given investment, with periodic constant payments and a constant interest rate

    +PV

    +Calculates the present value of an investment (i.e. the total amount that a series of future payments is worth now)

    +RATE

    +Calculates the interest rate required to pay off a specified amount of a loan, or reach a target amount on an investment over a given period

    +SLN

    +Returns the straight-line depreciation of an asset for one period

    +SYD

    +Returns the sum-of-years' digits depreciation of an asset for a specified period

    +VDB

    +Returns the depreciation of an asset for a specified period, (including partial periods), using the double-declining balance method or another user-specified method

    +DOLLARDE

    +Converts a dollar price expressed as a fraction, into a dollar price expressed as a decimal

    +DOLLARFR

    +Converts a dollar price expressed as a decimal, into a dollar price expressed as a fraction

    +DURATION

    +Calculates the Macaulay duration of a security with an assumed par value of $100

    +RRI

    +Calculates an equivalent interest rate for the growth of an investment

    +FVSCHEDULE

    +Calculates the future value of an initial principal, after applying a series of compound interest rates

    +DISC

    +Calculates the discount rate for a security

    +INTRATE

    +Calculates the interest rate for a fully invested security

    +CUMIPMT

    +Calculates the cumulative interest paid between two specified periods

    +CUMPRINC

    +Calculates the cumulative principal paid on a loan, between two specified periods

    +RECEIVED

    +Calculates the amount received at maturity for a fully invested Security

    + +### Information Functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +ISERROR

    +Checks whether the value is an error and returns true or false

    +ISNUMBER

    +Checks whether the value is number and returns true or false

    +ISLOGICAL

    +Checks whether a value is logical value(TRUE/FALSE) and returns true or false

    +ISNA

    +Checks whether a value is #N/A and returns true or false

    +ISERR

    +Checks whether the value is an error except #N/A and returns true or false

    +ISBLANK

    +Checks whether the reference is to an empty cell and returns true or false

    +ISTEXT

    +Checks whether the value is text and returns true or false

    +ISNONTEXT

    +Checks whether the value is not text(blank cells are not text) and returns true or false

    +ISEVEN

    +Returns true if number is even

    +CONCATENATE

    +Joins together two or more text strings

    +DOLLAR

    +Converts a number to text using currency format

    +LEN

    +Returns the length of a supplied text string

    +FIXED

    +Rounds a supplied number to a specified number of decimal places, and then converts this into text

    +ISODD

    +Returns true if number is odd

    +ERROR.TYPE

    +Tests a supplied value and returns an integer relating to the supplied value's error type

    +N

    +Converts a non-number value to a number, a date to a serial number, the logical value TRUE to 1 and all other values to 0

    +NA

    +Returns the Excel #N/A error

    +CELL

    +Returns information about the contents, formatting or location of a given cell

    +INFO

    +Returns information about the the current operating environment

    +TYPE

    +Returns information about the data type of a supplied value

    +ISFORMULA

    +Tests if a supplied cell contains a formula and if so, returns TRUE; Otherwise, returns FALSE

    + +### Logical Functions + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +AND

    +Tests a number of user-defined conditions and returns TRUE if ALL of the conditions evaluate to TRUE, orFALSE otherwise

    +OR

    +Tests a number of user-defined conditions and returns TRUE if ANY of the conditions evaluate to TRUE, orFALSE otherwise

    +IF

    +Tests a user-defined condition and returns one result if the condition is TRUE, and another result if the condition is FALSE

    +IFERROR

    +Tests if an initial supplied value (or expression) returns an error, and if so, returns a supplied value; Otherwise the function returns the initial value.

    +FALSE

    +Simply returns the logical value FALSE

    +TRUE

    +Simply returns the logical value TRUE

    +NOT

    +Returns a logical value that is the opposite of a user supplied logical value or expression

    + +### Lookup & Reference Functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +OFFSET

    +Returns a reference to a range of cells that is a specified number of rows and columns from an initial supplied range

    +HLOOKUP

    +Looks up a supplied value in the first row of a table, and returns the corresponding value from another row

    +VLOOKUP

    +Looks up a supplied value in the first column of a table, and returns the corresponding value from another column

    +MATCH

    +Finds the relative position of a value in a supplied array

    +COLUMN

    +Returns the column number of a supplied range, or of the current cell

    +ROW

    +Returns the row number of a supplied range, or of the current cell

    +INDIRECT

    +Returns a cell or range reference that is represented by a supplied text string

    +AREAS

    +Returns the number of areas in a supplied range

    +COLUMNS

    +Returns the number of columns in a supplied range

    +FORMULATEXT

    +Returns a formula as a string

    +HYPERLINK

    +Creates a hyperlink to a document in a supplied location

    +ROW

    +Returns the row number of a supplied range, or of the current cell

    +ROWS

    +Returns the number of rows in a supplied range

    +SHEET

    +Returns the sheet number of the referenced sheet

    +TRANSPOSE

    +Performs a transpose transformation on a range of cells (i.e. transforms a horizontal range of cells into a vertical range and vice versa)

    +SHEETS

    +Returns the number of sheets in reference

    + +### Math & Trigonometry functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +ABS

    +Returns the absolute value of a number

    +ACOS

    +Returns the arccosine of a number

    +ACOSH

    +Returns the inverse hyperbolic cosine of a number

    +ASIN

    +Returns the arcsine of a number

    +ASINH

    +Returns the inverse hyperbolic sine of a number

    +ATAN

    +Returns the arctangent of a number

    +ATAN2

    +Returns the arctangent from x- and y-coordinates

    +ATANH

    +Returns the inverse hyperbolic tangent of a number

    +SUM

    +Adds its arguments

    +PI

    +Returns the value of pi

    +POWER

    +Returns the result of a number raised to a power

    +POW

    +Returns the result of a number raised to a power

    +SUBTOTAL

    +Returns a subtotal in a list or database

    +COS

    +Returns the cosine of a number

    +SIN

    +Returns the sine of the given angle

    +COSH

    +Returns the hyperbolic cosine of a number

    +SINH

    +Returns the hyperbolic sine of a number

    +TANH

    +Returns the hyperbolic tangent of a number

    +TAN

    +Returns the tangent of a number

    +ACOT

    +Returns the arc cotangent of a number, in radians in the range 0 to Pi

    +ACOTH

    +Returns the inverse hyperbolic cotangent of a number

    +SIGN

    +Returns the sign of a number

    +SQRT

    +Returns a positive square root

    +ROUND

    +Rounds a number to a specified number of digits

    +LOG

    +Returns the logarithm of a number to a specified base

    +LOG10

    +Returns the base-10 logarithm of a number

    +EXP

    +Returns e raised to the power of a given number

    +CEILING

    +Rounds a number to the nearest integer or to the nearest multiple of significance

    +CEILING.MATH

    +Returns the RoundUp of the given number to the given significance

    +COLUMNS

    +Returns the number of columns of the passed in cell reference

    +FLOOR

    +Rounds a number down, toward zero

    +PRODUCT

    +Multiplies its arguments

    +MOD

    +Returns the remainder from division

    +TRUNC

    +Truncates a number to an integer

    +INT

    +Rounds a number down to nearest integer

    +ISEVEN

    +Returns true if the number is even

    +SUMPRODUCT

    +Returns the sum of the products of corresponding array components

    +EXP

    +Returns e raised to the power of a given number

    +INT

    +Rounds a number down to the nearest integer

    +RAND

    +Returns an evenly distributed random number >= 0 and < 1

    +COMBIN

    +Returns the number of combinations for a given number of objects

    +DEGREES

    +Converts radians to degrees

    +EVEN

    +Rounds a number up to the nearest even integer

    +FACT

    +Returns the factorial of a number

    +LN

    +Returns the natural logarithm of a number

    +ODD

    +Rounds a number up to the nearest odd integer

    +RADIANS

    +Converts degrees to radians

    +ROUNDDOWN

    +Rounds a number down, toward zero

    +ROUNDUP

    +Rounds a number up, away from zero

    +MROUND

    +Returns a number rounded to the desired multiple

    +MULTINOMIAL

    +Returns the multinomial of a set of numbers

    +QUOTIENT

    +Returns the integer portion of a division

    +FACTDOUBLE

    +Returns the double factorial of a number

    +GCD

    +Returns the greatest common divisor

    +LCM

    +Returns the least common multiple

    +SQRTPI

    +Returns the square root of (number * pi)

    +ROMAN

    +Converts an Arabic numeral to Roman, as text

    +SUMSQ

    +Returns the sum of the squares of the arguments

    +SUMX2MY2

    +Returns the sum of the difference of squares of corresponding values in two arrays

    +SUMX2PY2

    +Returns the sum of the sum of squares of corresponding values in two arrays

    +SUMXMY2

    +Returns the sum of squares of differences of corresponding values in two arrays

    +SUMIFS

    +Adds the cells specified by a given set of conditions or criteria

    +SEC

    +Returns the secant of an angle

    +SECH

    +Returns the hyperbolic secant of an angle

    +COT

    +Returns the cotangent of an angle

    +COTH

    +Returns the hyperbolic cotangent of a number

    +CSC

    +Returns the cosecant of an angle

    +CSCH

    +Returns the hyperbolic cosecant of an angle

    +TRUNCATE

    +Truncates a number to an integer

    +COMBINA

    +Returns the number of combinations for a given number of objects

    +BASE

    +Converts number into text representation

    +DECIMAL

    +Converts text representation of a number in a given base into decimal number

    +ARABIC

    +Converts a roman numeral to Arabic

    +CEILING.MATH

    +Rounds a number to the nearest integer or to the nearest multiple of significance

    +MDETERM

    +Returns the matrix determinant of an array

    +MMULT

    +Returns the matrix product of two arrays

    +MINVERSE

    +Returns the matrix inverse of an array

    +MUNIT

    +Returns the unit matrix for the specified dimension

    + +### Statistical functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +AVG

    +Returns the average of its arguments

    +AVERAGE

    +Returns the average of its arguments

    +MAX

    +Returns the maximum value in a list of arguments

    +MIN

    +Returns the minimum value in a list of arguments

    +MAXA

    +Returns the maximum value in a list of arguments, including numbers, text, and logical values

    +MINA

    +Returns the smallest value in a list of arguments, including numbers, text, and logical values

    +MEDIAN

    +Returns the median of the given numbers

    +CONFIDENCE.T

    +Returns the confidence interval for a population mean

    +SKEW.P

    +Returns the skewness of a distribution

    +COVARIANCE.P

    +Returns population covariance, the average of the products deviation for each data point pair in two data sets.

    +COVARIANCE.S

    +Returns the sample covariance, the average of the products deviation for each data point pair in two data sets.

    +PERCENTILE.EXC

    +Returns the Kth percentile of the values in a range, where K is in the range 0….1 exclusive

    +PERCENTILE.INC

    +Returns the Kth percentile of the values in a range, where K is in the range 0….1 inclusive

    +PERCENTRANK.EXC

    +Returns the rank of value in dataset as a percentage of the data set as percentage (0….1, exclusive) of the dataset

    +PERCENTRANC.INC

    +Returns the rank of value in dataset as a percentage of the data set as percentage (0….1, inclusive) of the dataset

    +STDEV.P

    +Calculates standard deviation based on the entire population

    +STDEV.S

    +Estimates standard deviation based on a sample

    +PERMUTATIONA

    +Returns the number of permutations for a given number of objects

    +NORM.DIST

    +Returns the normal cumulative distribution

    +NORM.INV

    +Returns the inverse of the normal cumulative distribution

    +NORM.S.DIST

    +Returns the standard normal cumulative distribution

    +NORM.S.INV

    +Returns the inverse of the standard normal cumulative distribution

    +WEIBULL.DIST

    +Returns the Weibull distribution

    +EXPON.DIST

    +Returns the exponential distribution

    +GAMMA.DIST

    +Returns the gamma distribution

    +GAMMA.INV

    +Returns the inverse of the gamma cumulative distribution

    +GAMMALN.PRECISE

    +Returns the natural logarithm of the gamma function, Γ(x)

    +T.INV

    +Returns the left-tailed inverse of the Student’s t-distribution

    +F.INV.RT

    +Returns the inverse of the right-tailed F probability distribution for two data sets

    +BINOM.INV

    +Returns the smallest value for which the cumulative binomial distribution is greater than or equal to a criterion value

    +HYPGEOM.DIST

    +Returns the hypergeometric distribution

    +LOGNORM.DIST

    +Returns the cumulative log-normal distribution 

    +LOGNORM.INV

    +Returns the inverse of the lognormal distribution

    +CONFIDENCE.NORM

    +Returns the confidence interval for a population mean, using a normal distribution

    +CHISQ.DIST.RT

    +Returns the right-tailed probability of the chi-squared distribution

    +F.DIST

    +Returns the F probability distribution

    +F.DIST.RT

    +Returns the right-tailed F probability distribution for two data sets

    +CHISQ.TEST

    +Returns the chi-squared statistical test for independence

    +CHISQ.INV

    +Returns the inverse of the left-tailed probability of the chi-squared distribution

    +CHISQ.INV.RT

    +Returns the inverse of the right-tailed probability of the chi-squared distribution

    +BINOM.DIST

    +Returns the individual term binomial distribution probability

    +Z.TEST

    +Returns the one-tailed probability value of a z-test

    +RANK.AVG

    +Returns the statistical rank of a given value, within a supplied array of values (if more than one value has same rank, the average rank is returned)

    +RANK.EQ

    +Returns the Mode (the most frequently occurring value) of a list of supplied numbers (if more than one value has same rank, the top rank of that set is returned)

    +NEGBINOM.DIST

    +Returns the negative binomial distribution

    +POISSON.DIST

    +Returns the Poisson distribution

    +QUARTILE.EXC

    +Returns the specified quartile of a set of supplied numbers, based on percentile value 0 - 1 (exclusive)

    +QUARTILE.INC

    +Returns the specified quartile of a set of supplied numbers, based on percentile value 0 - 1 (inclusive)

    +AVEDEV

    +Returns the average of the absolute deviations of data points from their mean

    +AVERAGEA

    +Returns the Average of a list of supplied numbers, counting text and the logical value FALSE as the value 0 and counting the logical value TRUE as the value 1

    +GAMMALN

    +Calculates the natural logarithm of the gamma function for a supplied value

    +GAMMADIST

    +Returns the gamma distribution

    +GAMMAINV

    +Returns the inverse gamma cumulative distribution

    +GEOMEAN

    +Returns the geometric mean of a set of supplied numbers

    +HARMEAN

    +Returns the harmonic mean of a set of supplied numbers

    +HYPGEOMDIST

    +Returns the hypergeometric distribution 

    +INTERCEPT

    +Calculates the best fit regression line, through a supplied series of x- and y- values and returns the value at which this line intercepts the y-axis

    +BINOMDIST

    +Returns the individual term binomial distribution probability

    +CHIDIST

    +Returns the right-tailed probability of the chi-squared distribution

    +CHIINV

    +Returns the inverse of the right-tailed probability of the chi-squared distribution

    +CHITEST

    +Returns the chi-squared statistical test for independence

    +NORMDIST

    +Returns the normal cumulative distribution

    +NORMINV

    +Returns the inverse of the normal cumulative distribution

    +NORMSINV

    +Returns the inverse of the standard normal cumulative distribution

    +NORMSDIST

    +Returns the standard normal cumulative distribution

    +CONFIDENCE

    +Returns the confidence interval for a population mean, using a normal distribution 

    +CORREL

    +Returns the correlation coefficient between two sets of values

    +COUNT

    +Returns the number of numerical values in a supplied set of cells or values

    +COUNTA

    +Returns the number of non-blanks in a supplied set of cells or values

    +COUNTBLANK

    +Returns the number of blank cells in a supplied range

    +COUNTIF

    +Returns the number of cells (of a supplied range), that satisfy a given criteria

    +COVAR

    +Returns population covariance (i.e. the average of the products of deviations for each pair within two supplied data sets)

    +CRITBINOM

    +Returns the smallest value for which the cumulative binomial distribution is greater than or equal to a criterion value

    +DEVSQ

    +Returns the sum of the squares of the deviations of a set of data points from their sample mean

    +EXPONDIST

    +Returns the exponential distribution

    +FDIST

    +Returns the F probability distribution (probability density or cumulative distribution function)

    +FINV

    +Returns the inverse of the right-tailed F probability distribution for two data sets

    +FISHER

    +Returns the Fisher transformation

    +FISHERINV

    +Returns the inverse of the Fisher transformation

    +FORECAST

    +Predicts a future point on a linear trend line fitted to a supplied set of x- and y- values

    +KURT

    +Returns the kurtosis of a data set

    +LARGE

    +Returns the Kth LARGEST value from a list of supplied numbers, for a given value K

    +LOGNORMDIST

    +Returns the cumulative log-normal distribution

    +LOGINV

    +Returns the inverse of the lognormal distribution

    +MODE

    +Returns the Mode (the most frequently occurring value) of a list of supplied numbers

    +NEGBINOMDIST

    +Returns the negative binomial distribution

    +PEARSON

    +Returns the Pearson product moment correlation coefficient

    +PERCENTILE

    +Returns the K'th percentile of values in a supplied range, where K is in the range 0 - 1 (inclusive)

    +PERCENTILERANK

    +Returns the rank of a value in a data set, as a percentage (0 - 1 inclusive)

    +PERMUT

    +Returns the number of permutations for a given number of objects

    +POISSON

    +Returns the Poisson distribution

    +PROB

    +Returns the probability that values in a supplied range are within given limits

    +QUARTILE

    +Returns the specified quartile of a set of supplied numbers, based on percentile value 0 - 1 (inclusive)

    +RANQ

    +Returns the Mode (the most frequently occurring value) of a list of supplied numbers (if more than one value has same rank, the top rank of that set is returned)

    +RSQ

    +Returns the square of the Pearson product moment correlation coefficient

    +SKEW

    +Returns the skewness of a distribution

    +SLOPE

    +Returns the slope of the linear regression line through a supplied series of x- and y- values

    +SMALL

    +Returns the Kth SMALLEST value from a list of supplied numbers, for a given value K

    +STANDARDIZE

    +Returns a normalized value

    +STDEV

    +Returns the standard deviation of a supplied set of values (which represent a sample of a population)

    +STDEVA

    +Returns the standard deviation of a supplied set of values (which represent a sample of a population), counting text and the logical value FALSE as the value 0 and counting the logical value TRUE as the value 1

    +STDEVP

    +Returns the standard deviation of a supplied set of values (which represent an entire population)

    +STDEVPA

    +Returns the standard deviation of a supplied set of values (which represent an entire population), counting text and the logical value FALSE as the value 0 and counting the logical value TRUE as the value 1

    +STEYX

    +Returns the standard error of the predicted y-value for each x in the regression line for a set of supplied x- and y- values

    +TRIMMEAN

    +Returns the mean of the interior of a supplied set of values

    +VAR

    +Returns the variance of a supplied set of values (which represent a sample of a population)

    +VARA

    +Returns the variance of a supplied set of values (which represent a sample of a population), counting text and the logical value FALSE as the value 0 and counting the logical value TRUE as the value 1

    +VARP

    +Returns the variance of a supplied set of values (which represent an entire population)

    +VARPA

    +Returns the variance of a supplied set of values (which represent an entire population), counting text and the logical value FALSE as the value 0 and counting the logical value TRUE as the value 1

    +WEIBULL

    +Returns the Weibull distribution

    +ZTEST

    +Returns the one-tailed probability value of a z-test

    + +### Text Functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Name

    +Description

    +LEFT

    +Returns a specified number of characters from the start of a supplied text string

    +LEN

    +Returns the length of a supplied text string

    +TRUNC

    +Truncates a number to an integer removing decimal part or fractional part

    +MID

    +Returns a specified number of characters from the middle of a supplied text string

    +RIGHT

    +Returns a specified number of characters from the end of a supplied text string

    +VALUE

    +Converts a text string into a numeric value

    +DOLLAR

    +Converts a supplied number into text, using a currency format

    +FIXED

    +Rounds a supplied number to a specified number of decimal places, and then converts this into text

    +LOWER

    +Converts all characters in a supplied text string to lower case

    +UPPER

    +Converts all characters in a supplied text string to upper case

    +TEXT

    +Converts a supplied value into text, using a user-specified format

    +TRIM

    +Removes duplicate spaces, and spaces at the start and end of a text string

    +CONCATENATE

    +Joins together two or more text strings

    +SUBSTITUTE

    +Substitutes all occurrences of a search text string, within an original text string, with the supplied replacement text

    +T

    +Tests whether a supplied value is text and if so, returns the supplied text; If not, returns an empty text string.

    +CODE

    +Returns the numeric code for the first character of a supplied string

    +FINDB

    +Returns the position of a supplied character or text string from within a supplied text string (case-sensitive)

    +LEFTB

    +Returns a specified number of characters from the start of a supplied text string

    +LENB

    +Returns the length of a supplied text string

    +MINB

    +Returns the smallest value in a set of values. does not ignore logical text and values

    +RIGHTB

    +Returns a specified number of characters from the end of a supplied text string

    +NUMBERVALUE

    +Converts text to a number, in a locale-independent way

    +PROPER

    +Converts all characters in a supplied text string to proper case (i.e. letters that do not follow another letter are upper case and all other characters are lower case)

    +REPLACE

    +Replaces all or part of a text string with another string (from a user supplied position)

    +REPT

    +Returns a string consisting of a supplied text string, repeated a specified number of times

    +SEARCHB

    +Returns the position of a supplied character or text string from within a supplied text string (non-case-sensitive)

    +UNICHAR

    +Returns the Unicode character that is referenced by the given numeric value

    +UNICODE

    +Returns the number (code point) corresponding to the first character of a supplied text string 

    + +### Web Functions + + + + + + + + + + +
    +Name

    +Description

    +ENCODEURL

    +Returns a URL-encoded string 

    +FILTERXML

    +Returns data from XML content, using a specified XPath

    +WEBSERVICE

    +Returns data from a web service on the Internet or Intranet

    diff --git a/Document-Processing/Excel/Spreadsheet/Getting-Started.md b/Document-Processing/Excel/Spreadsheet/Getting-Started.md new file mode 100644 index 00000000..645bc3db --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Getting-Started.md @@ -0,0 +1,300 @@ +--- +layout: post +title: Getting Started with UWP Spreadsheet control | Syncfusion® +description: Learn here about getting started with Syncfusion® UWP Spreadsheet (SfSpreadsheet) control, its elements and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Getting Started with UWP Spreadsheet (SfSpreadsheet) + +This section helps you to get started with the SfSpreadsheet + +## Assemblies Deployment + +Below table describes, list of assemblies required to be added in project when the SfSpreadsheet control is used in your application. + + + + + + + + + + + + + + + + + + + + +
    +Assembly +Description
    +Syncfusion.SfCellGrid.UWP.dll +Contains the base and fundamental classes which holds the underlying architecture for displaying cells with virtualized behavior and selection/interaction of cells.
    +Syncfusion.SfGridCommon.UWP.dll +Covers the classes which holds the properties of scroll viewer and disposable elements
    +Syncfusion.SfSpreadsheet.UWP.dll +Contains the classes that handles all the UI Operations of SfSpreadsheet such as importing of sheets, applying formulas/styles etc.
    +Syncfusion.SfShared.UWP.dll +Contains the classes which holds the properties and operations of the controls like SfUpDown, SfNavigator, Looping control etc
    +Syncfusion.SfInput.UWP.dll +Contains the classes which holds the controls like SfDropDownButton, SfTextBoxExt,SfMaskedEdit etc.
    +Syncfusion.SfRibbon.UWP.dll +Covers the classes which holds the Ribbon controls such as SfRibbon, SfRibbonMenu, SfRibbonGalleryItem etc.
    +Syncfusion.SfTabControl.UWP.dll +Covers the classes which holds the controls like SfTabControl, SfTabItem etc
    +Syncfusion.XlsIO.UWP.dll +Contains the base classes which is responsible for read and write in Excel files, Worksheet Manipulations, Formula calculations etc.
    +Below are the assemblies list that can be added when you want to enable certain features in SfSpreadsheet control. + + + + + + + + + + +
    +Optional Assemblies +Description
    +Syncfusion.SfSpreadsheetHelper.UWP.dll +Contains the classes which is responsible for importing charts and sparklines into SfSpreadsheet
    +Syncfusion.ExcelChartToImageConverter.UWP.dll +Contains the classes which is responsible for converting charts as image
    +Syncfusion.SfChart.UWP.dll +Contains the classes which is responsible for importing charts like Line charts, Pie charts, Sparklines etc.
    + + +## Create a Simple Application with SfSpreadsheet + +SfSpreadsheet control can be added into the application either via designer or via coding. + + +### Adding a Control via Designer + +1.Create new UWP application in Visual Studio. + +2.Open the Visual Studio **Tool** **box**. Navigate to “Syncfusion® Controls” tab, and find the SfSpreadsheet/SfSpreadsheetRibbon toolbox items + +![Getting-Started_img1](Getting-Started_images/Getting-Started_img1.jpg) + +3.Drag `SfSpreadsheet` and drop in to the Designer area from the Toolbox + +_For_ _Spreadsheet:_ + +{% tabs %} +{% highlight xaml %} + + + +{% endhighlight %} +{% endtabs %} + +4.Ribbon can be added to the application by dragging and dropping `SfSpreadsheetRibbon` to the Designer area. + +5.To make an interaction between Ribbon items and SfSpreadsheet, need to bind the `SfSpreadsheet` as DataContext to the `SfSpreadsheetRibbon`. + +_For_ _Ribbon:_ + +{% tabs %} +{% highlight xaml %} + + + +{% endhighlight %} +{% endtabs %} + + +### Adding Control Via Coding + +Spreadsheet is available in the following namespace “_Syncfusion_._UI_._Xaml_._Spreadsheet_” and it can be created programmatically either by using XAML or C# code. + +{% tabs %} + +{% highlight xaml %} + + + + + + +{% endhighlight %} + +{% highlight c# %} + +SfSpreadsheet spreadsheet = new SfSpreadsheet(); +this.grid.Children.Add(spreadsheet); + +{% endhighlight %} + +{% endtabs %} + +_You_ _can_ _get_ _the_ _following_ _output_ _when_ _execute_ _the_ _application._ + +![Getting-Started_img2](Getting-Started_images/Getting-Started_img2.jpg) + +N> To load the SfSpreadsheet in Windows Mobile, add the below code in MainPage.xaml file in DeviceFamily-Mobile folder. + +{% tabs %} +{% highlight xaml %} + + + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + + +## Creating a new Excel Workbook + +A new workbook can be created by using a `Create` method with specified number of worksheets. By default, a workbook will be created with single worksheet. + +{% tabs %} +{% highlight c# %} + + spreadsheet.Create(2); + +{% endhighlight %} +{% endtabs %} + +## Opening an existing Excel Workbook + +The Excel Workbook can be opened in SfSpreadsheet using the `Open` method in various ways, + +{% tabs %} +{% highlight c# %} + +//Using Stream, +spreadsheet.Open (Stream file) + +//Using StorageFile, +spreadsheet.Open (StorageFile file) + +//Using Workbook, +spreadsheet.Open(IWorkbook workbook) + +{% endhighlight %} +{% endtabs %} + +{% tabs %} +{% highlight c# %} + +Stream fileStream = typeof(MainPage).GetTypeInfo().Assembly.GetManifestResourceStream("SfSpreadsheetDemo.Assets.BidDetails.xlsx"); +this.spreadsheet.Open(fileStream); + +{% endhighlight %} +{% endtabs %} + +![Getting-Started_img4](Getting-Started_images/Getting-Started_img4.jpg) + + +## Saving the Excel Workbook + +The Excel workbook can be saved in SfSpreadsheet using `Save` method. If the workbook already exists in the system drive, it will be saved in the same location, otherwise Save Dialog box opens to save the workbook in user specified location. + +{% tabs %} +{% highlight c# %} + + spreadsheet.Save(); + +{% endhighlight %} +{% endtabs %} + +You can also use `SaveAs` method directly to save the existing excel file with modifications. + +The `SaveAs` method in SfSpreadsheet can be used in various ways, + +{% tabs %} +{% highlight c# %} + +//Using Storage File, +spreadsheet.SaveAs (StorageFile file); + +//Using String, +spreadsheet.SaveAs (string file); + +//For Dialog box, +spreadsheet.SaveAs(); + +{% endhighlight %} +{% endtabs %} + +## Displaying Charts and Sparklines + +For importing charts and sparklines in SfSpreadsheet, add the following assembly as reference into the application. + +Assembly: **Syncfusion.SfSpreadsheetHelper.UWP.dll** + +### Charts + +Create an instance of `Syncfusion.UI.Xaml.SpreadsheetHelper.GraphicChartCellRenderer` and add that renderer into `GraphicCellRenderers` collection by using the helper method `AddGraphicChartCellRenderer` which is available under the namespace `Syncfusion.UI.Xaml.Spreadsheet.GraphicCells`. + +{% tabs %} +{% highlight c# %} + +public MainWindow() +{ + InitializeComponent(); + + //For importing charts, + this.spreadsheet.AddGraphicChartCellRenderer(new GraphicChartCellRenderer()); +} + +{% endhighlight %} +{% endtabs %} + +### Sparklines + +Create an instance of `Syncfusion.UI.Xaml.SpreadsheetHelper.SparklineCellRenderer` and add that renderer into the Spreadsheet by using the helper method `AddSparklineCellRenderer` which is available under the namespace `Syncfusion.UI.Xaml.Spreadsheet.GraphicCells`. + +{% tabs %} +{% highlight c# %} + +public MainWindow() +{ + InitializeComponent(); + + //For importing sparklines, + this.spreadsheet.AddSparklineCellRenderer(new SparklineCellRenderer()); +} + +{% endhighlight %} +{% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img1.jpg b/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img1.jpg new file mode 100644 index 00000000..d7f55b99 Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img1.jpg differ diff --git a/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img2.jpg b/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img2.jpg new file mode 100644 index 00000000..59e451cc Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img2.jpg differ diff --git a/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img4.jpg b/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img4.jpg new file mode 100644 index 00000000..a09a09d2 Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/Getting-Started_images/Getting-Started_img4.jpg differ diff --git a/Document-Processing/Excel/Spreadsheet/Interactive-Features.md b/Document-Processing/Excel/Spreadsheet/Interactive-Features.md new file mode 100644 index 00000000..142f5b81 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Interactive-Features.md @@ -0,0 +1,237 @@ +--- +layout: post +title: Interactive Features in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Interactive Features support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Interactive Features in UWP Spreadsheet (SfSpreadsheet) + + This section explains about the interactive operations with SfSpreadsheet + +## Clipboard Operations + +SfSpreadsheet provides support for all the clipboard operations to with all the format settings when copied within a workbook. + +You can use the following shortcut keys for Clipboard operations like Excel + + + + + + + + + +
    +Operations +Shortcut Keys
    +Cut +Ctrl + X
    +Copy +Ctrl + C
    +Paste +Ctrl + V
    + +The following are a list of paste options used while performing paste operation, + + + + + + + + + + + + + + + + +
    +Options +Description
    +Paste +To paste with all the format options in the source range
    +Formula +To paste the formulas alone
    +Keep Source Formatting +To maintain the source range’s formatting
    +Value +To paste the values alone
    +Format +To paste only the formats alone without pasting the values.
    +Value & Source Formatting +To maintain the source range original format and paste only values
    + +N> When the content is copied from external source, SfSpreadsheet does not support the format settings (paste options). + +For `Cut` Operation, + +{% tabs %} +{% highlight c# %} + +//To perform cut operation for selected ranges +var range = spreadsheet.ActiveGrid.SelectedRanges.ActiveRange; +spreadsheet.ActiveGrid.CopyPaste.Copy(range, true); + +//To perform cut operation +spreadsheet.ActiveGrid.CopyPaste.Cut(); + +{% endhighlight %} +{% endtabs %} + +For `Copy` Operation, + +{% tabs %} +{% highlight c# %} + +//To perform copy operation for selected ranges +var range = spreadsheet.ActiveGrid.SelectedRanges.ActiveRange; +spreadsheet.ActiveGrid.CopyPaste.Copy(range, false); + +//To perform Copy operation +spreadsheet.ActiveGrid.CopyPaste.Copy(); + +{% endhighlight %} +{% endtabs %} + +For `Paste` Operation, + +{% tabs %} +{% highlight c# %} + +//To perform paste operation +spreadsheet.ActiveGrid.CopyPaste.Paste(); + +//To perform paste operation with range and Paste Options +var copyPaste = spreadsheet.ActiveGrid.CopyPaste as SpreadsheetCopyPaste; +copyPaste.Paste(range); +copyPaste.Paste(range, PasteOptions.Paste); + +{% endhighlight %} +{% endtabs %} + +T> Users can also set their default `PasteOptions` while pasting in SfSpreadsheet, by using `DefaultPasteOption` Property. + +## Undo/Redo + +SfSpreadsheet provides support for Undo/Redo functionality like Microsoft Excel. + +The shortcut keys used for Undo/Redo Operations + + + + + + + + +
    +Operations +Shortcut Keys
    +Undo +Ctrl + Z
    +Redo +Ctrl + Y
    + +SfSpreadsheet has `History Manager` class that supports the implementation of undo/ redo operations + +By default, Undo/Redo operations in SfSpreadsheet is enabled. To disable the Undo/Redo operations, set the `Enabled` property of `History Manager` to be false. + +{% tabs %} +{% highlight c# %} + +spreadsheet.HistoryManager.Enabled = false; + +{% endhighlight %} +{% endtabs %} + +To programmatically, invoke the Undo/Redo operations, + +{% tabs %} +{% highlight c# %} + +spreadsheet.HistoryManager.Enabled = true; +spreadsheet.HistoryManager.Undo(); +spreadsheet.HistoryManager.Redo(); +{% endhighlight %} +{% endtabs %} + +## Context menu + +Context menu in SfSpreadsheet is customizable menu which can be used for various functionalities + +### Cell Context menu + +Cell Context menu opens when the user right-click on a worksheet cell or selection of cells in SfSpreadsheet. + +By default, Cell Context menu is enabled in SfSpreadsheet. To disable the Cell Context menu, set the `AllowCellContextMenu` property as false. + +{% tabs %} +{% highlight c# %} + +spreadsheet.AllowCellContextMenu = false; + +{% endhighlight %} +{% endtabs %} + +Users can also customize the Cell Context menu of SfSpreadsheet by using `CellContextMenuOpening` Event of `SpreadsheetGrid`. + +Adding the customized menu items in the CellContextMenuOpening Event, + +{% tabs %} +{% highlight c# %} + +spreadsheet.ActiveGrid.CellContextMenuOpening += ActiveGrid_CellContextMenuOpening; + +void ActiveGrid_CellContextMenuOpening(object sender, CellContextMenuOpeningEventArgs e) +{ + + //Adding Customized Menu item + + MenuItem PasteSpecial = new MenuItem(); + PasteSpecial.Header = "PasteSpecial"; + Image paste = new Image() { Source = new BitmapImage(new Uri(@"..\..\Icon\paste.png", UriKind.Relative)) }; + PasteSpecial.Icon = paste; + spreadsheet.ActiveGrid.CellContextMenu.Items.Add(PasteSpecial); + + //Remove the existing Context menu + spreadsheet.ActiveGrid.CellContextMenu.Items.RemoveAt(2); +} + +{% endhighlight %} +{% endtabs %} + +T> Custom Cell Context menu can also by added by assigning the customized menu items to the `CellContextMenu` property of `SpreadsheetGrid`. For your reference, [CustomContextMenu](https://www.syncfusion.com/kb/6728/how-to-create-a-customized-cell-context-menu-of-sfspreadsheet) + +## Cell Comments + +SfSpreadsheet provides support for cell comments like in excel to give the reader additional context for the data it contains. You can set the comment height and color for the particular comments at runtime by invoking `CellCommentOpening` Event of SpreadsheetGrid + +To enable the comment in SfSpreadsheet, set the `ShowComment` property of SpreadsheetGrid to true. + + +{% tabs %} +{% highlight c# %} + + spreadsheet.ActiveGrid.ShowComment = true; + +{% endhighlight %} +{% endtabs %} + +To set the comments for particular cell at run time, + +{% tabs %} +{% highlight c# %} + +spreadsheet.ActiveSheet.Range["E5"].AddComment().Text = "Sample Comment"; +spreadsheet.ActiveGrid.InvalidateCell(5, 5); + +{% endhighlight %} +{% endtabs %} + diff --git a/Document-Processing/Excel/Spreadsheet/Localization.md b/Document-Processing/Excel/Spreadsheet/Localization.md new file mode 100644 index 00000000..539d011e --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Localization.md @@ -0,0 +1,63 @@ +--- +layout: post +title: Localization in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Localization support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Localization in UWP Spreadsheet (SfSpreadsheet) + +Localization is the process of configuring the application to a specific language. SfSpreadsheet provides support to localize all the static text in a Ribbon and all dialogs to any desired language. Localization can be done by adding resource file and setting the specific culture in the application. + +SfSpreadsheet allows you to set custom resource using Resw file. You can define your string values in resource file for a specific culture and set the culture in your application. + +## Set Current UI Culture to the Application + +To set the CultureInformation in the Application, set the `CurrentUICulture` before the InitializeComponent() method is called. + +Setting of the culture information, + +{% tabs %} +{% highlight c# %} + +public MainPage() +{ + System.Globalization.CultureInfo.CurrentUICulture = new System.Globalization.CultureInfo("ja"); + InitializeComponent(); +} + +{% endhighlight %} +{% endtabs %} + +Now, the Application is set to the Japanese Culture info. + +## Localization using Resource file + +The following steps show how to implement the localization in SfSpreadsheet, + +* Create a folder and name it as ‘Resources’ in your application. +* Add the default resource[English("en-US")] file of `SfSpreadsheet` in the 'Resources' folder named as Syncfusion.SfSpreadsheet.UWP.resw. + You can download the Resw file [here](http://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.SfSpreadsheet.UWP.Resources1773657760) +* Create Resw(resource) file under the 'Resources' folder and name it as Syncfusion.SfSpreadsheet.UWP.[Culture name].resw. + For example, Syncfusion.SfSpreadsheet.UWP.ja.resw for Japanese culture. + +![UWP SfSpreadsheet displays added resource file](localization_images/Loc_Image1.png) + +* Add the resource key such as name and its corresponding localized value in Resource Designer of Syncfusion.SfSpreadsheet.UWP.ja.resw file. + For your reference, you can download the Japanese("ja-JP") Resw file [here](http://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.SfSpreadsheet.UWP.Resources.ja2068752327) + +![UWP SfSpreadsheet displays resource file item list](localization_images/Loc_Image2.png) + +The following screenshot shows you the localization in SfSpreadsheet, + +![UWP SfSpreadsheet displays locaization applied in sheet](localization_images/Loc_Image3.png) + +## Modifying the localized strings in Resource file + +Users can modify the default localized strings in Resource file by adding the default [Resw](http://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.SfSpreadsheet.UWP.Resources1773657760) (resource) file of `SfSpreadsheet` in the 'Resources' folder of your application and name it as Syncfusion.SfSpreadsheet.UWP.resw. + +Now, the default localized strings can be modified by changing the Name/Value pair in the Syncfusion.SfSpreadsheet.UWP.resw file. + +![UWP SfSpreadsheet displays modified resource file item](localization_images/Loc_Image4.jpg) diff --git a/Document-Processing/Excel/Spreadsheet/Outline.md b/Document-Processing/Excel/Spreadsheet/Outline.md new file mode 100644 index 00000000..e3093863 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Outline.md @@ -0,0 +1,116 @@ +--- +layout: post +title: Outline in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Outline support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Outline in UWP Spreadsheet (SfSpreadsheet) + +SfSpreadsheet provides support for outlines like in excel which makes your data easier to view. You can group or ungroup the data’s either by rows or columns. + +## Group rows and columns + +SfSpreadsheet provides support to group the specified range in a worksheet. + +To `Group` the rows/columns + +{% tabs %} +{% highlight c# %} + +//Group rows, +var gridRange = GridRangeInfo.Rows(4,8); +spreadsheet.Group(spreadsheet.ActiveSheet, gridRange, ExcelGroupBy.ByRows); + +//Group columns, +var gridRange = GridRangeInfo.Cols(4,8); +spreadsheet.Group(spreadsheet.ActiveSheet, gridRange, ExcelGroupBy.ByColumns); + +{% endhighlight %} +{% endtabs %} + +## Ungroup rows and columns + +SfSpreadsheet provides support to ungroup the specified range in a worksheet. + +To `Ungroup` the rows/columns + +{% tabs %} +{% highlight c# %} +//Ungroup rows, +var gridRange = GridRangeInfo.Rows(4,8); +spreadsheet.UnGroup(spreadsheet.ActiveSheet, gridRange, ExcelGroupBy.ByRows); + +//Ungroup columns, +var gridRange = GridRangeInfo.Cols(4,8); +spreadsheet.UnGroup(spreadsheet.ActiveSheet, gridRange, ExcelGroupBy.ByColumns); + +{% endhighlight %} +{% endtabs %} + +## Collapse or Expand Group + +Groups can be Expanded by `ExpandGroup` method and Collapsed by `CollapseGroup` method of XlsIO. + +{% tabs %} +{% highlight c# %} + +//Expand Rows, +spreadsheet.ActiveSheet.Range["A4:A8"].ExpandGroup(ExcelGroupBy.ByRows); +spreadsheet.ActiveGrid.RowHeights.SetHidden(4, 8, false); +spreadsheet.RefreshOutlines(true,false); + +//Expand Columns, +spreadsheet.ActiveSheet.Range["A3:F3"].ExpandGroup(ExcelGroupBy.ByColumns); +spreadsheet.ActiveGrid.ColumnWidths.SetHidden(1, 6, false); +spreadsheet.RefreshOutlines(false,true); + +//Collapse Rows, +spreadsheet.ActiveSheet.Range["A4:A8"].CollapseGroup(ExcelGroupBy.ByRows); +spreadsheet.ActiveGrid.RowHeights.SetHidden(4, 8, true); +spreadsheet.RefreshOutlines(true,false); + +//Collapse Columns, +spreadsheet.ActiveSheet.Range["A3:F3"].CollapseGroup(ExcelGroupBy.ByColumns); +spreadsheet.ActiveGrid.ColumnWidths.SetHidden(1, 6, true); +spreadsheet.RefreshOutlines(false,true); + +{% endhighlight %} +{% endtabs %} + +N> `RefreshOutlines` method is invoked to refresh/update the Outlines of the Group in SfSpreadsheet. + +## Change Outline Settings + +In SfSpreadsheet, users can change the outline settings by changing the display of summary rows to either below or above the details and summary columns to either left or right of the details in Outlines Group. + +{% tabs %} +{% highlight c# %} + +spreadsheet.ActiveSheet.PageSetup.IsSummaryRowBelow = false; +spreadsheet.ActiveSheet.PageSetup.IsSummaryColumnRight = false; +spreadsheet.RefreshOutlines(true, true); + +{% endhighlight %} +{% endtabs %} + +## Clear Outlines + +SfSpreadsheet provides support to clear all the Outlines of the Grouped range. + +{% tabs %} +{% highlight c# %} + +var sheet = spreadsheet.Workbook.Worksheets[0] as WorksheetImpl; + +foreach (OutlineWrapper outline in sheet.OutlineWrappers) +{ + outline.OutlineRange.Ungroup(outline.GroupBy); +} +spreadsheet.RefreshOutlines(true, true); + +{% endhighlight %} +{% endtabs %} + diff --git a/Document-Processing/Excel/Spreadsheet/Ribbon-Customization.md b/Document-Processing/Excel/Spreadsheet/Ribbon-Customization.md new file mode 100644 index 00000000..5feafc1a --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Ribbon-Customization.md @@ -0,0 +1,172 @@ +--- +layout: post +title: Ribbon Customization in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Ribbon Customization support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Ribbon Customization in UWP Spreadsheet (SfSpreadsheet) + +Ribbon Customization can be done in two ways, + +## Using Control Template: + +User can customize the ribbon items by overriding the template of `SfSpreadsheetRibbon`. + +## Using Event + +By invoking SfSpreadsheetRibbon Loaded Event, User can add/delete the ribbon menu items. + +### Adding a RibbonTab + +To create a custom Ribbon tab with user defined menu options in `SfSpreadsheetRibbon`, + +{% tabs %} +{% highlight xaml %} + + + +{% endhighlight %} +{% endtabs %} + +{% tabs %} +{% highlight c# %} + +ribbon.Loaded += ribbon_Loaded; + +void ribbon_Loaded(object sender, RoutedEventArgs e) +{ + var ribbon1 = GridUtil.GetVisualChild(sender as FrameworkElement); + + if (ribbon1 != null) + { + SfRibbonTab ribbonTab = new SfRibbonTab(); + ribbonTab.Caption = "OTHER"; + SfRibbonButton Button1 = new SfRibbonButton(); + Button1.Label = "PRINT"; + Button1.SizeMode = SizeMode.Large; + Button1.Click += Button1_Click; + + SfRibbonButton Button2 = new SfRibbonButton(); + Button2.Label = "PRINT PREVIEW"; + Button2.SizeMode = SizeMode.Large; + Button2.Click += Button2_Click; + + var customRibbonBar = new SfRibbonBar(); + customRibbonBar.Header = "Printing Options"; + customRibbonBar.Items.Add(Button1); + customRibbonBar.Items.Add(Button2); + ribbonTab.Items.Add(customRibbonBar); + ribbon1.Items.Add(ribbonTab); + } + +} + +{% endhighlight %} +{% endtabs %} + +### Adding a Ribbon Items in Existing Tab + +To add a ribbon items in already existing tab, + +{% tabs %} +{% highlight xaml %} + + + +{% endhighlight %} +{% endtabs %} + +{% tabs %} +{% highlight c# %} + +ribbon.Loaded += ribbon_Loaded; + +void ribbon_Loaded(object sender, RoutedEventArgs e) +{ + var ribbon1 = GridUtil.GetVisualChild(sender as FrameworkElement); + + // To add the ribbon button in View tab, + + if (ribbon1 != null) + { + var ribbonTab = ribbon1.Items[2] as RibbonTab; + RibbonButton Button1 = new RibbonButton(); + Button1.Label = "PRINT"; + Button1.SmallIcon = new BitmapImage(new Uri("/../Icon/Icons_Print.png", UriKind.Relative)); + Button1.Click += Button1_Click; + ribbonTab.Items.Add(Button1); + } +} + +{% endhighlight %} +{% endtabs %} + +### Removing a RibbonTab + +To remove the ribbon tab in the SfSpreadsheetRibbon, + +{% tabs %} +{% highlight xaml %} + + + +{% endhighlight %} +{% endtabs %} + +{% tabs %} +{% highlight c# %} + +ribbon.Loaded += ribbon_Loaded; + +void ribbon_Loaded(object sender, RoutedEventArgs e) +{ + var ribbon1 = GridUtil.GetVisualChild(sender as FrameworkElement); + + //To remove the Data tab from the ribbon, + + if (ribbon1 != null) + { + var item = ribbon1.Items[1]; + ribbon1.Items.Remove(item); + } +} + +{% endhighlight %} +{% endtabs %} + + +### Removing a Ribbon Items in a RibbonTab + +To remove the ribbon menu items in the ribbon tab of SfSpreadsheetRibbon, + +{% tabs %} +{% highlight xaml %} + + + +{% endhighlight %} +{% endtabs %} + +{% tabs %} +{% highlight c# %} + +ribbon.Loaded += ribbon_Loaded; + +void ribbon_Loaded(object sender, RoutedEventArgs e) +{ + var ribbon1 = GridUtil.GetVisualChild(sender as FrameworkElement); + + // To remove the Freeze panes menu group in View tab, + + if (ribbon1 != null) + { + var ribbonTab = ribbon1.Items[2] as RibbonTab; + ribbonTab.Items.Remove(ribbonTab.Items[1]); + } +} + +{% endhighlight %} +{% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/Rows-and-Columns.md b/Document-Processing/Excel/Spreadsheet/Rows-and-Columns.md new file mode 100644 index 00000000..118f2046 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Rows-and-Columns.md @@ -0,0 +1,228 @@ +--- +layout: post +title: Rows and Columns in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Rows and Columns support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Rows and Columns in UWP Spreadsheet (SfSpreadsheet) +This section explains about the operations related with rows and columns in SfSpreadsheet + +## Insert Rows and Columns + +SfSpreadsheet provides support for dynamically inserting rows and columns into a worksheet. + +{% tabs %} +{% highlight c# %} + +//For Inserting Rows +spreadsheet.ActiveSheet.InsertRow(2, 3); +spreadsheet.ActiveGrid.Model.InsertRows(2, 3); + +//For Inserting Cols +spreadsheet.ActiveSheet.InsertColumn(3, 2); +spreadsheet.ActiveGrid.Model.InsertColumns(3, 2); + +{% endhighlight %} +{% endtabs %} + +###Events + +Below events of `SpreadsheetGridModel` are triggered while inserting the rows and columns. + +* `RowsInserted` +* `ColumnsInserted` + +{% tabs %} +{% highlight c# %} + +//To notify when rows are inserted +spreadsheet.ActiveGrid.Model.RowsInserted += Model_RowsInserted; + +void Model_RowsInserted(object sender, GridRangeInsertedEventArgs e) +{ +} + +//To notify when Columns are inserted +spreadsheet.ActiveGrid.Model.ColumnsInserted += Model_ColumnsInserted; + +void Model_ColumnsInserted(object sender, GridRangeInsertedEventArgs e) +{ +} +{% endhighlight %} +{% endtabs %} + +## Delete Rows and Columns + +SfSpreadsheet provides support for deleting rows and columns from a worksheet, + +{% tabs %} +{% highlight c# %} + +//For Deleting Rows +spreadsheet.ActiveSheet.DeleteRow(5, 2); +spreadsheet.ActiveGrid.Model.RemoveRows(5, 2); + +//For Deleting Cols +spreadsheet.ActiveSheet.DeleteColumn(3, 2); +spreadsheet.ActiveGrid.Model.RemoveColumns(3, 2); + +{% endhighlight %} +{% endtabs %} + +###Events + +Below events of `SpreadsheetGridModel` are triggered while deleting the rows and columns. + +* `RowsRemoved` +* `ColumnsRemoved` + +{% tabs %} +{% highlight c# %} + +//To notify when rows are deleted +spreadsheet.ActiveGrid.Model.RowsRemoved += Model_RowsRemoved; + +void Model_RowsRemoved(object sender, GridRangeRemovedEventArgs e) +{ +} + +//To notify when columns are deleted +spreadsheet.ActiveGrid.Model.ColumnsRemoved += Model_ColumnsRemoved; + +void Model_ColumnsRemoved(object sender, GridRangeInsertedEventArgs e) +{ +} + +{% endhighlight %} +{% endtabs %} + +## Hide Rows and Columns + +SfSpreadsheet provides support to hide rows/columns and this can be done by `HideRow` and `HideColumn` method + +{% tabs %} +{% highlight c# %} + +//For Hiding Rows, +spreadsheet.ActiveSheet.HideRow(5); +spreadsheet.ActiveGrid.RowHeights.SetHidden(5, 5, true); + +//For Hiding Cols, +spreadsheet.ActiveSheet.HideColumn(4); +spreadsheet.ActiveGrid.ColumnWidths.SetHidden(4, 4, true); + +{% endhighlight %} +{% endtabs %} + +## Unhide Rows and Columns + +Unhide the rows/columns in SfSpreadsheet can be done by `ShowRow` and `ShowColumn` methods. + +{% tabs %} +{% highlight c# %} + +//For Unhiding Rows, +spreadsheet.ActiveSheet.ShowRow(5, true); +spreadsheet.ActiveGrid.RowHeights.SetHidden(5, 5, false); + +//For Unhiding Cols, +spreadsheet.ActiveSheet.ShowColumn(4,true); +spreadsheet.ActiveGrid.ColumnWidths.SetHidden(4, 4, false); + +{% endhighlight %} +{% endtabs %} + +## Row Height and Column Width + +SfSpreadsheet provides support to adjust the row height and column width. And also can import the adjusted row height and column width from Excel. SfSpreadsheet provides support to fit the row and column based on its contents. + +{% tabs %} +{% highlight c# %} + +//For setting RowHeight for 4th Row +spreadsheet.ActiveGrid.SetRowHeight(4, 4, 30); +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Row(4), true); + +//For setting ColumnWidth for 5th Column +spreadsheet.ActiveGrid.SetColumnWidth(5, 5, 22); +spreadsheet.ActiveGrid.InvalidateCell(GridRangeInfo.Col(5), true); + +{% endhighlight %} +{% endtabs %} + +N> In case if you insert/delete and hide/unhide the rows/columns inside the Grouping, `RefreshOutlines` method must be invoked to refresh/update the Outlines of the Group. + +## Freeze Rows and Columns + +SfSpreadsheet provides support for Freeze panes to keep an area of a worksheet visible while you scroll to another area of the worksheet. + +{% tabs %} +{% highlight c# %} + +//Freeze panes + +//To Freeze 4 rows and 4 columns +spreadsheet.Workbook.ActiveSheet.Range[4, 4].FreezePanes(); +spreadsheet.ActiveGrid.FrozenRows = 5; +spreadsheet.ActiveGrid.FrozenColumns = 5; + +{% endhighlight %} +{% endtabs %} + +## Unfreeze Rows and Columns + +SfSpreadsheet provides support to unfreeze the freeze panes in the worksheet of SfSpreadsheet. + +{% tabs %} +{% highlight c# %} + +//Unfreeze panes + +//To Unfreeze 4 rows and 4 columns +spreadsheet.Workbook.ActiveSheet.RemovePanes(); +spreadsheet.ActiveGrid.FrozenRows = 1; +spreadsheet.ActiveGrid.FrozenColumns = 1; + +{% endhighlight %} +{% endtabs %} + +## Auto Fit Rows and Columns + +SfSpreadsheet provides support to fit the rows or columns based on its content at run time. + +You can fit the rows/columns by calling `AutoFitRows` and `AutoFitColumns` methods of XlsIO’s `IRange`. Also set the adjusted row height and column width into the grid by using `SetRowHeight` and `SetColumnWidth` methods of `SpreadsheetGrid`. + +{% tabs %} +{% highlight c# %} + +//To AutoFit a single column, +spreadsheet.ActiveSheet.AutofitColumn(2); +spreadsheet.ActiveGrid.SetColumnWidth(2,2,spreadsheet.ActiveSheet.GetColumnWidthInPixels(2)); + +//To AutoFit multiple columns, +spreadsheet.ActiveSheet["A1:D100"].AutofitColumns(); + +for(int i = 1; i <= 4 ; i++) +{ + spreadsheet.ActiveGrid.SetColumnWidth(i,i,spreadsheet.ActiveSheet.GetColumnWidthInPixels(i)); +} + +//To AutoFit a single row, +spreadsheet.ActiveSheet.AutofitRow(3); +spreadsheet.ActiveGrid.SetRowHeight(3,3,spreadsheet.ActiveSheet.GetRowHeightInPixels(3)); + +//To AutoFit multiple rows, +spreadsheet.ActiveSheet["B1:B5"].AutofitRows(); + +for(int i = 1; i <= 5 ; i++) +{ + spreadsheet.ActiveGrid.SetRowHeight(i,i,spreadsheet.ActiveSheet.GetRowHeightInPixels(i)); +} + +{% endhighlight %} +{% endtabs %} + + diff --git a/Document-Processing/Excel/Spreadsheet/Selection.md b/Document-Processing/Excel/Spreadsheet/Selection.md new file mode 100644 index 00000000..9cc0f2c6 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Selection.md @@ -0,0 +1,359 @@ +--- +layout: post +title: Selection in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Selection support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Selection in UWP Spreadsheet (SfSpreadsheet) + +This section explains about the Selection behavior in SfSpreadsheet. + +The SfSpreadsheet control provides support for selection in grid by using mouse, keyboard and touch interactions. + +By default, Selection behavior will be enabled in `SfSpreadsheet`,but if you want to disable the selection in SfSpreadsheet, then set the `AllowSelection` Property to be false. + +{% tabs %} +{% highlight c# %} + +void spreadsheet_WorkbookLoaded(object sender, WorkbookLoadedEventArgs args) +{ + spreadsheet.ActiveGrid.AllowSelection = false; +} + +{% endhighlight %} +{% endtabs %} + +## Accessing the Current cell + +SfSpreadsheet allows the user to access the active cell by using the `CurrentCell` property of `SelectionController` Class. + +{% tabs %} +{% highlight c# %} + +var cell= spreadsheet.ActiveGrid.SelectionController.CurrentCell; + +{% endhighlight %} +{% endtabs %} + +## Accessing the Selected ranges + +SfSpreadsheet allows the user to access the selected ranges of the `SpreadsheetGrid` using `SelectedRanges` property of `SpreadsheetGrid`. + +{% tabs %} +{% highlight c# %} + +var rangeList = spreadsheet.ActiveGrid.SelectedRanges; + +{% endhighlight %} +{% endtabs %} + +N> To get the active range in the selected ranges list, use `ActiveRange` property of `GridRangeInfoList` class. + +## Adding or Clearing the Selection + +SfSpreadsheet allows the user to add and clear the selection in the Active `SpreadsheetGrid` for the given range. + +{% tabs %} +{% highlight c# %} + +//To Add the Selection for range, +spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Cells(4,6,5,8)); + +//To Add the Selection for particular row, +spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Row(4)); + +//To Add the Selection for multiple rows, +spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Rows(4,9)); + +//To Add the Selection for particular column, +spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Col(5)); + +//To Add the Selection for multiple columns, +spreadsheet.ActiveGrid.SelectionController.AddSelection(GridRangeInfo.Cols(5,10)); + +//To Clear the Selection, +spreadsheet.ActiveGrid.SelectionController.ClearSelection(); + +{% endhighlight %} +{% endtabs %} + +## Move Current Cell + +SfSpreadsheet allows the user to move the current cell to the mentioned cell in `SpreadsheetGrid`. + +{% tabs %} +{% highlight c# %} + +//Moves current cell to the mentioned row and column index of cell, +spreadsheet.ActiveGrid.CurrentCell.MoveCurrentCell(5, 5); + +For moving the current cell to a different sheet, + +spreadsheet.SetActiveSheet("Sheet2"); +spreadsheet.ActiveGrid.CurrentCell.MoveCurrentCell(6, 5); + +{% endhighlight %} +{% endtabs %} + +## Converting GridRangeInfo into IRange + +SfSpreadsheet allows the user to convert the `GridRangeInfo` into the equivalent `IRange` by using `ConvertGridRangeToExcelRange` method of `GridExcelHelper` class. + +{% tabs %} +{% highlight c# %} + +var excelRange = GridExcelHelper.ConvertGridRangeToExcelRange(GridRangeInfo.Cell(4, 5), spreadsheet.ActiveGrid); + +{% endhighlight %} +{% endtabs %} + +T> Users can also convert the `IRange` into equivalent `GridRangeInfo` by using `ConvertExcelRangeToGridRange` method of `GridExcelHelper` class. + +## Properties, Methods and Events + +Below table lists the events associated with selection behavior, + + + + + + + + + + + + + + +
    +Events +Description
    +CellClick + Occurs when you click on the cell.
    +CurrentCellActivating +Occurs when the current cell is going to be activated. This event allow to cancel the current cell activation.
    +CurrentCellActivated +Occurs after the current cell is activated.
    +SelectionChanging +Occurs when the selection is going to be changed. This event allows to cancel the selection change.
    +SelectionChanged +Occurs after the selection is changed.
    + +Below table lists the properties associated with selection, + + + + + + + + + + + + + + + + + + + + +
    +Properties +Description
    +SelectedRanges +Gets or sets the collection of selected ranges from grid.
    +SelectionBrush +Gets or sets the selected area brush.
    +SelectionBorderBrush +Gets or sets the selection border brush.
    +SelectionBorderThickness +Gets or sets the thickness of selection border.
    +SelectionController + Gets the Selection Controller which provides the selection of content when the user drags the pressed mouse to an edge of the control.
    +AllowSelection +Gets or Sets the value whether to allow the selection in the ActiveGrid or not.
    +ShowTouchIndicator +Determines whether the touch indicator will be shown or not.
    +TouchHitTestPrecision +Gets or sets the distance of touch precision point from touch indicator.
    + +Below table lists the properties associated with `CurrentCell` of `SpreadsheetGrid`, + + + + + + + + + + + + + + + + +
    +Properties +Description
    +CellRowColumnIndex +Gets the row and column index of the CurrentCell.
    +RowIndex +Gets the row index of the CurrentCell.
    +ColumnIndex +Gets the column index of the CurrentCell.
    +Range +Gets the range of the CurrentCell.
    +HasCurrentCell +Gets the value indicating whether the Grid has CurrentCell or not.
    +PreviousRowColumnIndex +Gets or sets the row and column index of old CurrentCell.
    + +Below table lists the methods associated with selection, + + + + + + + + + + +
    +Methods +Description
    +AddSelection +Adds/Extends the Selection to the mentioned range .
    +ClearSelection +Clears the Selection.
    +MoveCurrentCell +Move the Current cell to mentioned row and column index.
    + +## Key Navigation + +Below table lists the key combinations associated with selection, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Key Combination +Description
    +HOME +Moves to the first cell of the current row .
    +END +Moves to the last cell of the current row .
    +UPARROW + +Moves to one cell up of the current cell in the worksheet.
    +DOWNARROW + +Moves to one cell down of the current cell in the worksheet.
    +LEFTARROW + +Moves to one cell left of the current cell in the worksheet.
    +RIGHTARROW + +Moves to one cell right of the current cell in the worksheet.
    +PAGEUP +Moves to the first visible cell of the current column.
    +PAGEDOWN +Moves to the last visible cell of the current column.
    +CTRL+HOME +Moves to the beginning cell of a worksheet.
    +CTRL+END +Moves to the last cell of a worksheet.
    +ALT+PAGE UP +Moves one screen to the left in a worksheet.
    +ALT+PAGE DOWN +Moves one screen to the right in a worksheet.
    +CTRL + ARROW KEYS +Moves to the first/last cell of the current cell based on Arrow directions .
    +ENTER +Moves the active current cell to one cell down in the selection.
    +SHIFT+ENTER +Moves the active current cell to one cell up in the selection.
    +TAB +Moves the active current cell in one cell to the right of the selection.
    +SHIFT+TAB +Moves the active current cell in one cell to the left of the selection.
    +BACKSPACE +Begins the edit operation for the active cell in the selection.
    +CTRL+A +Selects the entire worksheet.
    +SHIFT+ARROW KEYS +Extends the selection by one cell based on the arrow direction.
    +CTRL+SHIFT+ARROW KEYS +Extend the selection to the last cell in a row or column.
    +SHIFT+HOME +Extends the selection to the first column from the active cell.
    +CTRL+SHIFT+HOME +Extends the selection from the active cell to the first cell.
    +SHIFT+PAGE DOWN +Extends the selection down in a worksheet.
    +SHIFT+PAGE UP +Extends the selection up in a worksheet.
    + + + + + diff --git a/Document-Processing/Excel/Spreadsheet/Shapes.md b/Document-Processing/Excel/Spreadsheet/Shapes.md new file mode 100644 index 00000000..82fd123a --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Shapes.md @@ -0,0 +1,185 @@ +--- +layout: post +title: Shapes in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Shapes support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Shapes in UWP Spreadsheet (SfSpreadsheet) + This section explains about importing of charts, sparklines, pictures and textboxes in SfSpreadsheet. + +## Charts + +SfSpreadsheet provides support to import charts from excel which are used to represent numeric data in graphical format to make it easier to understand large quantities of data. + +For importing charts in SfSpreadsheet, add the following assembly as reference into the application. + +Assembly: **Syncfusion.SfSpreadsheetHelper.UWP.dll** + +Create an instance of `Syncfusion.UI.Xaml.SpreadsheetHelper.GraphicChartCellRenderer` and add that renderer into `GraphicCellRenderers` collection by using the helper method `AddGraphicChartCellRenderer` which is available under the namespace `Syncfusion.UI.Xaml.Spreadsheet.GraphicCells`. + +{% tabs %} +{% highlight c# %} + +public MainWindow() +{ + InitializeComponent(); + + //For importing charts, + this.spreadsheet.AddGraphicChartCellRenderer(new GraphicChartCellRenderer()); +} + +{% endhighlight %} +{% endtabs %} + +### Adding the Charts at runtime + +For adding the Charts in SfSpreadsheet at runtime, use `AddChart` method, also you can resize and reposition the chart. + +{% tabs %} +{% highlight c# %} + +var chart = spreadsheet.AddChart(spreadsheet.ActiveSheet); + +object[] Y_values = new object[] { 200, 100, 100 }; +object[] X_values = new object[] { "Total Income", "Expenses", "Profit" }; + +IChartSerie series = chart.Series.Add(ExcelChartType.Pie); + +// Enters the X and Y values directly +series.EnteredDirectlyValues = Y_values; +series.EnteredDirectlyCategoryLabels = X_values; + +var shape = chart as ShapeImpl; + +// Re-Positioning Chart +shape.Top = 200; +shape.Left = 200; + +//Re-sizing a Chart +shape.Height = 300; +shape.Width = 300; +{% endhighlight %} +{% endtabs %} + + +## Sparklines + +For importing sparklines in SfSpreadsheet, add the following assembly as reference into the application. + +Assembly: **Syncfusion.SfSpreadsheetHelper.UWP.dll** + +Create an instance of `Syncfusion.UI.Xaml.SpreadsheetHelper.SparklineCellRenderer` and add that renderer into the Spreadsheet by using the helper method `AddSparklineCellRenderer` which is available under the namespace `Syncfusion.UI.Xaml.Spreadsheet.GraphicCells`. + +{% tabs %} +{% highlight c# %} + +public MainWindow() +{ + InitializeComponent(); + + //For importing sparklines, + this.spreadsheet.AddSparklineCellRenderer(new SparklineCellRenderer()); +} + +{% endhighlight %} +{% endtabs %} + +## Pictures + +SfSpreadsheet provides support to import images in SpreadsheetGrid and to add an image at run time, use `AddImage` method and also you can resize and reposition the image. + +{% tabs %} +{% highlight c# %} + +var worksheet = spreadsheet.ActiveSheet; +var stream = typeof(MainWindow).Assembly.GetManifestResourceStream("GraphicCellDemo.Data.Sample.jpg"); +var shape = spreadsheet.AddImage(worksheet, new RowColumnIndex(5, 5), stream); + +// Re-Positioning Picture +shape.Top = 200; +shape.Left = 200; + + //Re-sizing a Picture +shape.Height = 200; +shape.Width = 200; + +{% endhighlight %} +{% endtabs %} + + +## Text Boxes + +SfSpreadsheet provides support to import RichText Box in SpreadsheetGrid and to add the rich text box at run time, use `AddTextBox` method + +{% tabs %} +{% highlight c# %} + +var rtfText = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset1 Calibri;}{\\f1\\fnil\\fcharset1 Calibri;}}{\\colortbl;\\red0\\green0\\blue0;\\red255\\green0\\blue0;}{\\f0\\fs22\\b\\cf1\\u83*\\u121*\\u110*\\u99*\\u102*\\u117*\\u115*\\u105*\\u111*\\u110*\\u32*\\b0} {\\f1\\fs22\\cf2\\u83*\\u111*\\u102*\\u116*\\u119*\\u97*\\u114*\\u101*\\u32*}{\\f1\\fs22\\cf1\\u80*\\u118*\\u116*\\u46*\\u32*\\u76*\\u116*\\u100*}}"; +var textBox = spreadsheet.AddTextBox(spreadsheet.ActiveSheet, new RowColumnIndex(5, 5), new Size(200, 200), rtfText) as TextBoxShapeImpl; + +// Re-positioning RichTextBox +textBox.Left = 200; +textBox.Top = 200; + +{% endhighlight %} +{% endtabs %} + +## Accessing the selected Shapes + +SfSpreadsheet allows the user to access the selected shapes and modify the properties associated with it in `SpreadsheetGrid`. + +{% tabs %} +{% highlight c# %} + +var selectedShape = spreadsheet.ActiveGrid.GraphicModel.SelectedShapes; + +for(int i = 0; i < selectedShape.Count ; i++) +{ + + if(ExcelShapeType.Chart == selectedShape[i].ShapeType) + { + var chart = selectedShape[i] as IChart; + chart.ChartArea.Fill.FillType = ExcelFillType.Gradient; + chart.ChartArea.Fill.ForeColor = Color.Blue; + } + + else if(ExcelShapeType.Picture == selectedShape[i].ShapeType) + { + var picture = selectedShape[i] as ShapeImpl; + picture.Height = 100; + picture.Width = 100; + } +} +spreadsheet.ActiveGrid.GraphicModel.InvalidateGraphicObjects(); +spreadsheet.ActiveGrid.GraphicModel.InvalidateGraphicVisual(); + +{% endhighlight %} +{% endtabs %} + +## Select a Shape Programmatically + +Users can select a shape programmatically by using `AddSelectedShapes` method of `GraphicModel` class. + +{% tabs %} +{% highlight c# %} + +var shape = spreadsheet.ActiveSheet.Shapes[2] as ShapeImpl; +spreadsheet.ActiveGrid.GraphicModel.AddSelectedShapes(shape); + +{% endhighlight %} +{% endtabs %} + +## Clear a Selection + +Users can clear the selection from the shapes and move the selection to the grid using `ClearSelection` method of `GraphicModel` class. + +{% tabs %} +{% highlight c# %} + +spreadsheet.ActiveGrid.GraphicModel.ClearSelection(); + +{% endhighlight %} +{% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/Working-with-SfSpreadsheet.md b/Document-Processing/Excel/Spreadsheet/Working-with-SfSpreadsheet.md new file mode 100644 index 00000000..17a2e068 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Working-with-SfSpreadsheet.md @@ -0,0 +1,364 @@ +--- +layout: post +title: Working With Spreadsheet in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Working With Spreadsheet support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Working With Spreadsheet in UWP Spreadsheet (SfSpreadsheet) + This section explains about accessing the Worksheet, Grid and the events associated with it. + +## Accessing the Worksheet + +A __workbook__ is an excel document in the SfSpreadsheet. It is an object that exposes the `IWorkbook` interface. Currently loaded workbook in the Spreadsheet can be accessed by using the `Workbook` property of SfSpreadsheet. + +A workbook consists of one or more worksheets stored within the worksheet collection. Accessing the worksheets in the collection, can be done by the following ways, + +{% tabs %} +{% highlight c# %} + +//By Specifying the index as, +spreadsheet.Workbook.Worksheets[0] + +//By Specifying the sheet name as, +spreadsheet.Workbook.Worksheets["sheet1"] + +//Access the Active worksheet as, +spreadsheet.ActiveSheet + +{% endhighlight %} +{% endtabs %} + +For more information regarding working with worksheets, you can refer the [XlsIO UG](http://help.syncfusion.com/file-formats/xlsio/overview) link + +N> `ActiveGrid` and `ActiveSheet` property can be accessed only after the `WorkbookLoaded` Event of `SfSpreadsheet` is triggered + +## Accessing the Grid + +Each worksheet in the workbook is loaded into the view as `SpreadsheetGrid` in `SfSpreadsheet`. + +When the workbook is loaded in the SfSpreadsheet, the `WorkbookLoaded` Event is invoked and when the workbook is removed from SfSpreadsheet, the `WorkbookUnloaded` Event is invoked. + +When the worksheet is added into the SfSpreadsheet, the `WorksheetAdded` Event is invoked and when the worksheet is removed in the SfSpreadsheet, `WorksheetRemoved` Event is invoked. + +Hence you can access the `ActiveGrid` either in the `WorkbookLoaded` or `WorksheetAdded` Event. + +{% tabs %} +{% highlight c# %} + +spreadsheet.WorksheetAdded += spreadsheet_WorksheetAdded; +spreadsheet.WorksheetRemoved += spreadsheet_WorksheetRemoved; + +void spreadsheet_WorksheetAdded(object sender, WorksheetAddedEventArgs args) +{ + + //Access the Active SpreadsheetGrid and hook the events associated with it. + var grid = spreadsheet.ActiveGrid; + grid.CurrentCellActivated += grid_CurrentCellActivated; +} + +void spreadsheet_WorksheetRemoved(object sender, WorksheetRemovedEventArgs args) +{ + + //Access the Active SpreadsheetGrid and unhook the events associated with it + var grid = spreadsheet.ActiveGrid; + grid.CurrentCellActivated -= grid_CurrentCellActivated; +} + +{% endhighlight %} +{% endtabs %} + +You can also access the each `SpreadsheetGrid` in the SfSpreadsheet either by passing the particular sheet name in the `GridCollection` or by invoking `WorkbookLoaded` Event of SfSpreadsheet. + +### By using Sheet Name + +For your reference, setting the row and column count dynamically for the second sheet in the Workbook + +{% tabs %} +{% highlight c# %} + +var sheet = spreadsheet.Workbook.Worksheets[1]; +spreadsheet.GridCollection[sheet.Name].RowCount = 50; +spreadsheet.GridCollection[sheet.Name].ColumnCount = 12; + +{% endhighlight %} +{% endtabs %} + +### By using Event + +{% tabs %} +{% highlight c# %} + +spreadsheet.WorkbookLoaded += spreadsheet_WorkbookLoaded; +spreadsheet.WorkbookUnloaded += spreadsheet_WorkbookUnloaded; + +void spreadsheet_WorkbookLoaded(object sender, WorkbookLoadedEventArgs args) +{ + + //Hook the events here + + foreach (var grid in args.GridCollection) + { + grid.QueryRange += grid_QueryRange; + } +} + +void spreadsheet_WorkbookUnloaded(object sender, WorkbookUnloadedEventArgs args) +{ + + //Unhook the events here + + foreach (var grid in args.GridCollection) + { + grid.QueryRange -= grid_QueryRange; + } +} + +{% endhighlight %} +{% endtabs %} + +N> SfSpreadsheet supports virtual mode, which lets you dynamically provide data to the grid by handling an event, `QueryRange`, for example. In virtual mode, data will be dynamically loaded into the SpreadsheetGrid on demand or when users need to view the data. + +## Setting the ActiveSheet programmatically + +SfSpreadsheet allows you to set the `ActiveSheet` programmatically by specifying the sheet name in the `SetActiveSheet` method of `SfSpreadsheet`. + +{% tabs %} +{% highlight c# %} + +spreadsheet.SetActiveSheet("Sheet5"); + +{% endhighlight %} +{% endtabs %} + + +## Accessing the cell or range of cells + +SfSpreadsheet allows to access a single cell or range of cells in the workbook using `IRange` interface. + +The following code shows the several ways of accessing a single cell or range of cells in the `Worksheet`, + +{% tabs %} +{% highlight c# %} + +// Access a cell by specifying cell address. +var cell = spreadsheet.Workbook.Worksheets[0].Range["A3"]; + +// Access a cell by specifying cell row and column index. +var cell1 = spreadsheet.Workbook.Worksheets[0].Range[3, 1]; + +// Access a cells by specifying user defined name. +var cell2 = spreadsheet.Workbook.Worksheets[0].Range["Namerange"]; + +// Accessing a range of cells by specifying cell's address. +var cell3 = spreadsheet.Workbook.Worksheets[0].Range["A5:C8"]; + +// Accessing a range of cells specifying cell row and column index. +var cell4 = spreadsheet.Workbook.Worksheets[0].Range[15, 1, 15, 3]; + +{% endhighlight %} +{% endtabs %} + +For more reference regarding accessing the range, refer [XlsIO](http://help.syncfusion.com/file-formats/xlsio/worksheet-cells-manipulation#accessing-a-cell-or-a-range) UG. + +N> If the user has made any modifications with XlsIO range in SfSpreadsheet, then they should [refresh the view](http://help.syncfusion.com/uwp/sfspreadsheet/working-with-sfspreadsheet#refreshing-the-view) to update the modifications in `SpreadsheetGrid`. + +## Accessing the value of a cell + +SfSpreadsheet allows you to access the value of a cell by using [Value](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IRange.html#Syncfusion_XlsIO_IRange_Value) property of `IRange` and to get the value of the cell along with its format, [DisplayText](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IRange.html#Syncfusion_XlsIO_IRange_DisplayText) property can be used. + +{% tabs %} +{% highlight c# %} + +// Access a cell value by using "Value" Property, +var cellValue = spreadsheet.Workbook.Worksheets[1].Range["A3"].Value + +// Access a cell value by using "DisplayText" Property. +var displayValue = spreadsheet.Workbook.Worksheets[1].Range[4, 1].DisplayText; + +{% endhighlight %} +{% endtabs %} + +## Setting the value or formula to a cell + +In SfSpreadsheet, to update the cell value and formula programmatically, `SetCellValue` method of `SpreadsheetGrid` should be invoked and then invalidate that cell to update the view. + +{% tabs %} +{% highlight c# %} + +var range = spreadsheet.ActiveSheet.Range[2,2]; +spreadsheet.ActiveGrid.SetCellValue(range, "cellValue"); +spreadsheet.ActiveGrid.InvalidateCell(2,2); + +{% endhighlight %} +{% endtabs %} + +## Clearing the value or formatting from a cell + +SfSpreadsheet allows you to delete the contents of a cell or delete the contents along with its formatting(comments,Conditional formats,..) also. + +The following code illustrates the different way of deleting the value from a cell, + +{% tabs %} +{% highlight c# %} + +//To clear the contents in the range alone, +spreadsheet.Workbook.Worksheets[0].Range[3, 3].Clear(); + +//To clear the contents along with its formatting in the range, +spreadsheet.Workbook.Worksheets[0].Range[3, 3].Clear(true); + +//To clear the range with specified ExcelClearOptions, +spreadsheet.Workbook.Worksheets[0].Range[3, 3].Clear(ExcelClearOptions.ClearDataValidations); + +{% endhighlight %} +{% endtabs %} + +N> [ExcelClearOptions](http://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.ExcelClearOptions.html) is an enum which specifies the possible directions to clear the cell formats, content, comments,conditional format,data validation or clear all of them. + +## Refreshing the view + +SfSpreadsheet allows you to invalidate or refresh the view either by specifying the specific range or full range. + +The following code demonstrates the different ways of refreshing the view, + +{% tabs %} +{% highlight c# %} + +//Invalidates the mentioned cell in the grid, +spreadsheet.ActiveGrid.InvalidateCell(3, 3); + +//Invalidates the range , +var range = GridRangeInfo.Cells(5, 4, 6, 7); +spreadsheet.ActiveGrid.InvalidateCell(range); + +//Invalidates all the cells in the grid, +spreadsheet.ActiveGrid.InvalidateCells(); + +//Invalidates the measurement state(layout) of grid, +spreadsheet.ActiveGrid.InvalidateVisual(); + +//Invalidates the cell borders in the range, +var range = GridRangeInfo.Cells(2, 4, 6, 4); +spreadsheet.ActiveGrid.InvalidateCellBorders(range); + +{% endhighlight %} +{% endtabs %} + +## Scrolling the Grid programmatically + +SfSpreadsheet allows the user to scroll the grid into mentioned cell, by using `ScrollInView` method of `SpreadsheetGrid`. + +{% tabs %} +{% highlight c# %} + +spreadsheet.ActiveGrid.ScrollInView(new RowColumnIndex(5, 5)); + +{% endhighlight %} +{% endtabs %} + +## Formula Bar + +The Formula Bar is located above the worksheet area of the SfSpreadsheet. The formula bar displays the data or formula stored in the active cell. +Users can set the visibility state of Formula Bar using `FormulaBarVisibility` property of `SfSpreadsheet`. + +{% tabs %} +{% highlight xaml %} + + + +{% endhighlight %} +{% highlight c# %} + +spreadsheet.FormulaBarVisibility = Windows.UI.Xaml.Visibility.Collapsed; + +{% endhighlight %} +{% endtabs %} + +## Identify whether the workbook is modified or not + +`IsCellModified` property of `WorkbookImpl` is used to identify whether any cell modified in a workbook or not after importing. Since it is an internal property, access it using Reflection. + +{% tabs %} +{% highlight c# %} + +var workbook = spreadsheet.Workbook as WorkbookImpl; +var binding = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic; +var value = typeof(WorkbookImpl).GetProperty("IsCellModified", binding).GetValue(workbook); + +{% endhighlight %} +{% endtabs %} + +## Suppress message boxes in Spreadsheet + +In Spreadsheet, warning messages, error alerts are displayed while performing some actions like Excel. If you want to avoid those alerts, then set the `DisplayAlerts` property to `false`. + +{% tabs %} +{% highlight c# %} + +//To Suppress message boxes in Spreadsheet +spreadsheet.DisplayAlerts = false; + +{% endhighlight %} +{% endtabs %} + +## Suspend and resume formula calculation + +Spreadsheet provides support to suspend the formula calculation and resume it whenever needed using the `SuspendFormulaCalculation` and `ResumeFormulaCalculation` method. + +Resuming formula calculation will recalculate all the formula cells in a workbook. This would be helpful to improve the performance when you are updating the value of more number of cells by skipping the dependent cells recalculation on each cell value changed. + +{% tabs %} +{% highlight c# %} + +//Resumes the automatic formula calculation +spreadsheet.ResumeFormulaCalculation(); + +//Suspends the automatic formula calculation +spreadsheet.SuspendFormulaCalculation(); + + +{% endhighlight %} +{% endtabs %} + +## Close the popup programmatically + +In SfSpreadsheet, popup windows are used to display the options like copy paste option, fill series option, etc. which will be closed automatically on certain actions. However you can also able to close the popup programmatically by using the `ShowHidePopup` method of `SpreadsheetGrid`. + +{% tabs %} +{% highlight c# %} + +//To close the popup +spreadsheet.ActiveGrid.ShowHidePopup(false); + +//To show the closed popup, if needed. +spreadsheet.ActiveGrid.ShowHidePopup(true); + +{% endhighlight %} +{% endtabs %} + +## Identify when the active sheet is changed + +SfSpreadsheet provides support to identify when the active sheet is changed by using `PropertyChanged` event of SfSpreadsheet like below. + +{% tabs %} +{% highlight c# %} + +Spreadsheet.PropertyChanged += Spreadsheet_PropertyChanged; + +void Spreadsheet_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) +{ + + // when the worksheets in the workbook changed + + if(e.PropertyName == "ActiveSheet") + { + + //Implement code + } +} + +{% endhighlight %} +{% endtabs %} diff --git a/Document-Processing/Excel/Spreadsheet/Worksheet-Management.md b/Document-Processing/Excel/Spreadsheet/Worksheet-Management.md new file mode 100644 index 00000000..8a306bc2 --- /dev/null +++ b/Document-Processing/Excel/Spreadsheet/Worksheet-Management.md @@ -0,0 +1,241 @@ +--- +layout: post +title: Worksheet Management in UWP Spreadsheet control | Syncfusion® +description: Learn here all about Worksheet Management support in Syncfusion® UWP Spreadsheet (SfSpreadsheet) control and more. +platform: UWP +control: SfSpreadsheet +documentation: ug +--- + +# Worksheet Management in UWP Spreadsheet (SfSpreadsheet) +This section explains about the operations that are performed with the worksheet. + +## Insert and Delete + +SfSpreadsheet provides support to insert and delete the worksheets in a workbook. + +{% tabs %} +{% highlight c# %} + +//Insert Sheet +spreadsheet.AddSheet(); + +//Insert sheet with name +spreadsheet.AddSheet("Sheet4", 3); + +//Delete Sheet +spreadsheet.RemoveSheet("Sheet2"); + +{% endhighlight %} +{% endtabs %} + +## Hide and Unhide + +SfSpreadsheet provides support to hide and unhide the worksheets in a workbook. + +{% tabs %} +{% highlight c# %} + +//Hide Sheet +spreadsheet.HideSheet("Sheet 2"); + +//Unhide Sheet +spreadsheet.UnhideSheet("Sheet 2"); + +{% endhighlight %} +{% endtabs %} + +## Rename a sheet programmatically + +SfSpreadsheet provides support to rename a worksheet in the workbook programmatically by using `RenameSheet` method. + +{% tabs %} + +{% highlight c# %} + +//To Rename a sheet programmatically +spreadsheet.RenameSheet("ExistingSheetName", "NewSheetName"); + +{% endhighlight %} +{% endtabs %} + +## Protection + +### Protecting a worksheet + +SfSpreadsheet provides support to protect the worksheet with or without password. This helps to prevent a user from modifying the contents of the worksheet. The protection of worksheet can be done with `ExcelSheetProtection` options also. + +The Protect sheet options are + +* LockedCells - Allows the users to select the locked cells of the protected worksheet. + +* UnLockedCells - Allows the users to select the unlocked cells of the protected worksheet. + +* FormattingCells - Allows the users to format any cell on a protected worksheet. + +* FormattingRows - Allows the users to format any row on a protected worksheet. + +* FormattingColumns - Allows the users to format any column on a protected worksheet. + +* InsertingRows - Allows the users to insert rows on the protected worksheet. + +* InsertingColumns - Allows the users to insert columns on the protected worksheet. + +* InsertingHyperlinks - Allows the users to insert hyperlinks on the protected worksheet. + +* DeletingRows - Allows the users to delete rows on the protected worksheet. + +* DeletingColumns - Allows the users to delete columns on the protected worksheet. + +* Objects - Allows the users to edit the objects such as Graphic cells like charts,rich textbox, etc. + +{% tabs %} +{% highlight c# %} + +//Protect the sheet with password +spreadsheet.ProtectSheet(spreadsheet.ActiveSheet, "123"); + +//Protect the sheet with Protection options +spreadsheet.ProtectSheet(spreadsheet.ActiveSheet, "123", ExcelSheetProtection.FormattingCells); + +//Unprotect the sheet +spreadsheet.UnProtectSheet(spreadsheet.ActiveSheet, "123"); + +{% endhighlight %} +{% endtabs %} + +### Protecting a workbook + +SfSpreadsheet provides support to protect the structure and windows of a workbook. By protecting the structure, prevent a user from adding or deleting worksheets or from displaying hidden worksheets. By protecting the windows in the workbook, you can control the size of the workbook, etc. + +{% tabs %} +{% highlight c# %} + +// To Protect the Workbook +spreadsheet.Protect(true, true, "123"); + +//To Unprotect the Workbook +spreadsheet.Unprotect("123"); + +{% endhighlight %} +{% endtabs %} + +## Gridlines + +SfSpreadsheet provides support to control the visibility and color of the Gridlines in a worksheet. + +{% tabs %} +{% highlight c# %} + +//To show GridLines +spreadsheet.SetGridLinesVisibility(true); + +//To hide GridLines +spreadsheet.SetGridLinesVisibility(false); + +{% endhighlight %} +{% endtabs %} + +## Headings + +SfSpreadsheet provides support to control the visibility of row and column headers in a worksheet + +{% tabs %} +{% highlight c# %} + +//To hide the Header cells visibility +spreadsheet.SetRowColumnHeadersVisibility(false); + +{% endhighlight %} +{% endtabs %} + +## Zooming + +SfSpreadsheet provides support to zoom in and zoom out of a worksheet view. The property `AllowZooming` determines whether to allow zooming or not. + +{% tabs %} +{% highlight c# %} + +//zoom factor +spreadsheet.SetZoomFactor("Sheet1", 200); + +{% endhighlight %} +{% endtabs %} + +The Events associated with the Zooming are + +. `ZoomFactorChanged` + +. `ZoomFactorChanging` + +## Events + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Events +Description
    +WorkbookCreating +Occurs when the workbook is to be created in SfSpreadsheet.
    +WorkbookLoaded +Occur when the workbook is loaded in SfSpreadsheet.
    +WorksheetAdding + +Occurs when the worksheet is to be added in SfSpreadsheet.
    +WorksheetAdded +Occurs when the worksheet is added in SfSpreadsheet.
    +WorksheetRemoving + +Occurs when the worksheet is to be removed from SfSpreadsheet.
    +WorksheetRemoved + +Occurs when the worksheet is removed from SfSpreadsheet.
    +WorkbookUnloaded +Occurs when the workbook is unloaded or removed from the SfSpreadsheet.
    +ZoomFactorChanged +Occurs when the zoom factor in SfSpreadsheet is changed.
    +ZoomFactorChanging +Occurs when the zoom factor in SfSpreadsheet is to be changed.
    +ResizingColumns +Occurs when performing the resizing columns in SfSpreadsheet.
    +ResizingRows +Occurs when performing the resizing rows in SfSpreadsheet.
    +CellCommentOpening +Occurs when opening the comments in the cells of SfSpreadsheet.
    +CellTooltipOpening +Occurs when opening the tool tips of cells in SfSpreadsheet.
    +CellContextMenuOpening +Occurs when opening the context menu of the cell in SfSpreadsheet.
    +QueryRange +Occurs when grid queries for IRange information about a specific cell while rendering.
    diff --git a/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image1.png b/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image1.png new file mode 100644 index 00000000..9510a6fd Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image1.png differ diff --git a/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image2.png b/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image2.png new file mode 100644 index 00000000..3b54d069 Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image2.png differ diff --git a/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image3.png b/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image3.png new file mode 100644 index 00000000..eb366d3c Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image3.png differ diff --git a/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image4.jpg b/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image4.jpg new file mode 100644 index 00000000..bdd89f3a Binary files /dev/null and b/Document-Processing/Excel/Spreadsheet/localization_images/Loc_Image4.jpg differ diff --git a/Document-Processing/Excel/Spreadsheet/overview.md b/Document-Processing/Excel/Spreadsheet/overview.md index f0727562..f5ca8205 100644 --- a/Document-Processing/Excel/Spreadsheet/overview.md +++ b/Document-Processing/Excel/Spreadsheet/overview.md @@ -1,13 +1,62 @@ --- -title: Microsoft Excel-like Spreadsheet Component | Syncfusion -description: View, edit & print Excel files in Windows Forms, WPF, JavaScript, Angular, React, Vue, Blazor, ASP.NET MVC, & ASP.NET Core applications without Microsoft Office dependencies. -platform: document-processing -control: general -documentation: UG -keywords: Excel, SDK, view, edit, read, Spreadsheet +layout: post +title: About UWP Spreadsheet control | Syncfusion® +description: Learn here all about introduction of Syncfusion® UWP Spreadsheet (SfSpreadsheet) control, its elements and more. +platform: UWP +control: SfSpreadsheet +documentation: ug --- -# Welcome to Syncfusion Spreadsheet Component +# UWP Spreadsheet (SfSpreadsheet) Overview -Syncfusion Spreadsheet component is a Microsoft Excel-like GUI component used to view, edit and print Excel files in Windows Forms, WPF, JavaScript, Angular, React, Vue, Blazor, ASP.NET MVC, and ASP.NET Core applications that works without Microsoft Office dependencies. It eases you developers to just integrate this viewer component to achieve the required Excel document viewing, editing functionalities and concentrate on core logics of your application. +The **SfSpreadsheet** is an Excel inspired control that allows you to create, edit, view and format the Microsoft Excel files without Excel installed. It provides absolute ease of use UI experience with integrated ribbon to cover any possible business scenario. SfSpreadsheet comes with built-in calculation engine with support for 400+ most widely used formulas. +## Key Features + +`SfSpreadsheet` includes several advanced features like + +**Ribbon** – Ribbon integrated with organically enhanced UI experience. + +**Editing** **and** **Selection**-Interactive support for editing and cell selection in workbook. + +**Formulas** - Provides support for 400+ most widely used formulas which any business user needs and allows you to add, remove and edit the formulas like in excel. + +**Name** **Manager** – Supports the name ranges in the formulas. By using the name ranges, you can specify the name of the cell range, and then you can use it in the formula more easily without hassling of remembering cell locations. + +**Floating** **Cells**- Provides support for floating cell mode that is when the text exceeds the length of the cell, it will float the text to the adjacent cell. + +**Merge** **Cells** - Merge two or more adjacent cells into a single cell and display the contents of one cell in the merged cell. + +**Conditional** **Formatting**- Provides support for excel compatible conditional formatting and allows you to apply formats to a cell or range of cells depending on the value of cells or formula that meet specific criteria. Also provides support to define and import the conditional formatting rules such as Data Bars, Icon Sets and Color Scales options which are used to visualize the data. + +**Data** **validation** – Provides support to ensure the data integrity by enforcing end users to enter valid data into the cells and if entered data does not meet the specified criteria, and error message is displayed. + +**Cell** **Comments**- Supports comments that provide additional information about a cell such as what the value represents. And it would be useful if you want the end users to understand the data in the cells more deeply. + +**Undo**/**Redo** - Provides support to undo or redo the changes that you have made in the workbook. + +**Clipboard** **Operations** – Provides support for Cut/Copy/Paste Operations in Spreadsheet. + +**Fill** **Series** – Provides support to automatically fill cells with data that follows or completes a pattern. + +**Charts**, **Pictures** **and** **Textboxes** - Provides support to import Charts, Pictures and Textboxes. + +**Sparklines** – Provides support to import sparklines. + +**Hyperlinks**- Supports the hyperlink navigation. The hyperlink is a convenient way to navigate or browse data within a worksheet or other worksheets in a workbook. + +**Freeze** **panes** – Provides support to freeze rows/ freeze columns. + +**Resizing** **and** **Hiding** – Provides interactive support to resize or hide/unhide the rows and columns. + +**Grouping** - Provides support to group or ungroup rows and columns. + +**Workbook** **and** **Worksheet** **Protection**- Provides support to protect the worksheet and also supports to lock-down the structure and window of workbook, which enables you to prevent workbook from any structural change or from any change in size. + +**Import** – Provides support to import from excel file. + +**Zooming** – Provides support to zoom in and zoom out of the worksheet view. + +**Localization** - Provides support to localize all the static text in a Ribbon and all dialogs to any desired language. + +**Supported file types** - Ability to import the different types of excel which are XLS, XLSX, XLSM, XLT, XLTX, CSV(Comma delimited) respectively. \ No newline at end of file