{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-formula",
  "framework": "aspnet-mvc",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "formula",
  "dependencies": [
    "Syncfusion.AspNetMvc.Spreadsheet"
  ],
  "description": "Spreadsheet editor populated from a prebuilt formula.xlsx byte payload loaded at startup.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/aspnet-mvc/llms.txt",
    "skillPack": "syncfusion/aspnetmvc-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/aspnet-mvc/spreadsheet-editor-formula.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-formula/SpreadsheetEditor.cshtml",
      "content": "@using Syncfusion.EJ2\n@using Syncfusion.EJ2.Spreadsheet\n\n@section ControlsSection{\n    <div class=\"control-section\">\n        @Html.EJS().Spreadsheet(\"spreadsheet\").ShowRibbon(false).Created(\"createdHandler\").Sheets(sheet =>\n   {\n       sheet.Name(\"Stock Details\").SelectedRange(\"F15\").Ranges(ranges =>\n       {\n           ranges.DataSource((IEnumerable<object>)ViewData[\"formulaData\"]).Add();\n       }).Rows(row =>{\n           row.Height(40).Cells(cell => {\n               cell.Index(3).Value(\"High (+)\").Add();\n               cell.Value(\"Low (-)\").Add();\n           }).Add();\n           row.Height(25).Index(11).Cells(cell => {\n               cell.Index(3).Value(\"Average profit:\").Add();\n               cell.Index(5).Formula(\"=AVERAGE(Profit)\").Format(\"0.00\").Add();\n           }).Add();\n           row.Height(25).Cells(cell => {\n               cell.Index(3).Value(\"Maximum stock value:\").Add();\n               cell.Index(5).Formula(\"=MAX(High)\").Format(\"0.00\").Add();\n           }).Add();\n           row.Height(25).Cells(cell => {\n               cell.Index(3).Value(\"Minimum stock value:\").Add();\n               cell.Index(5).Formula(\"=MIN(E2:E11)\").Add();\n           }).Add();\n           row.Height(25).Cells(cell => {\n               cell.Index(3).Value(\"Non-profitable days:\").Add();\n               cell.Index(5).Formula(\"=COUNTIF(F2:F11,\\\"<=0\\\")\").Add();\n           }).Add();\n       }).Columns(column => {\n           column.Width(100).Add();\n           column.Width(130).Add();\n           column.Width(140).Add();\n           column.Width(140).Add();\n           column.Width(130).Add();\n           column.Width(130).Add();\n       }).Add();\n   }).DefinedNames(definedName => {\n       definedName.Name(\"Profit\").RefersTo(\"=F2:F11\").Add();\n       definedName.Name(\"High\").RefersTo(\"=D2:D11\").Add();\n   }).Render()\n    </div>\n}\n\n<script>\n    function createdHandler() {\n        // Applies cell and number formatting to specified range of the active sheet\n        this.cellFormat({ fontWeight: 'bold', backgroundColor: '#279377', color: '#fff', textAlign: 'center', fontSize: '14px' }, 'A1:F1');\n        this.cellFormat({ backgroundColor: '#F2F2F2' }, 'A2:F11');\n        this.cellFormat({ fontWeight: 'bold', backgroundColor: '#EEEEEE' }, 'A12:F15');\n        this.numberFormat('0.00', 'F2:F11');\n        this.numberFormat('m/d/yyyy', 'A2:A11');\n    }\n</script>\n\n<style>\n    .control-section {\n        height: 550px;\n    }\n    #sb-content .e-spreadsheet .e-tab .e-tab-text {\n        display: inherit;\n    }\n</style>\n"
    },
    {
      "target": "src/components/spreadsheet-editor-formula/SpreadsheetEditorController.cs",
      "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.Mvc;\n\nnamespace EJ2MVCSampleBrowser.Controllers.Spreadsheet\n{\n    public partial class SpreadsheetController : Controller\n    {\n        public ActionResult Formula()\n        {\n           List<object> formulaData = new List<object>()\n            {\n                new { Date= \"08-01-2019\", Open= \"2625.75\", Close= \"2640.75\", High= \"2634.45\", Low= \"2620.65\", Profit= \"=C2-B2\" },\n                new { Date= \"08-02-2019\", Open= \"2640.75\", Close= \"2638.75\", High= \"2640.75\", Low= \"2638.75\", Profit= \"=C3-B3\" },\n                new { Date= \"08-03-2019\", Open= \"2638.75\", Close= \"2697.65\", High= \"2690.25\", Low= \"2647.65\", Profit= \"=C4-B4\" },\n            };\n            ViewData[\"formulaData\"] = formulaData;\n           return View(\"~/Views/Home/spreadsheet-editor/formula/SpreadsheetEditor.cshtml\");\n        }\n    }\n}"
    }
  ]
}