diff --git a/Document-Processing/Excel/Spreadsheet/Javascript-ES5/open-save.md b/Document-Processing/Excel/Spreadsheet/Javascript-ES5/open-save.md index 92ef33862..bffa1b352 100644 --- a/Document-Processing/Excel/Spreadsheet/Javascript-ES5/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/Javascript-ES5/open-save.md @@ -39,6 +39,7 @@ Please find the below table for the beforeOpen event arguments. | file | FileList or string or File | To get the file stream. `FileList` - contains length and item index.
`File` - specifies the file lastModified and file name. | | cancel | boolean | To prevent the open operation. | | requestData | object | To provide the Form data. | +| parseOptions | WorkbookParseOptions | Specifies options to control how the Excel file is loaded. You can skip specific properties to optimize performance. | > * Use `Ctrl + O` keyboard shortcut to open Excel documents. > * The default value of the [allowOpen](https://ej2.syncfusion.com/javascript/documentation/api/spreadsheet/#allowopen) property is `true`. For demonstration purpose, we have showcased the [allowOpen](https://ej2.syncfusion.com/javascript/documentation/api/spreadsheet/#allowopen) property in previous code snippet. @@ -301,22 +302,41 @@ The following code snippet demonstrates how to configure the deserialization opt ### Improving Excel file open performance with parsing options -Opening large Excel files into the EJ2 Spreadsheet control can sometimes lead to slower performance and increased memory usage. This is often caused by the processing of additional elements such as styles and number formats—even when the actual data content is minimal. For example, an Excel file with only a small amount of data but a large number of styled or formatted empty cells can significantly impact load time and memory consumption. +Opening large Excel files into the EJ2 Spreadsheet control can sometimes lead to slower performance and increased memory usage. This is often caused by the processing of additional elements such as styles, number formats, formulas, validations, conditional formats, merged cells, charts, and images—even when the actual data content is minimal. For example, an Excel file with only a small amount of data but a large number of styled or formatted empty cells can significantly impact load time and memory consumption. -To address this, we've introduced parsing options that allow users to selectively skip non-essential features during the open process. By enabling options like `IgnoreStyle` and `IgnoreFormat`, you can reduce the amount of data processed, resulting in: +To address this, we've introduced parsing options that allow users to selectively skip non-essential properties during the open process. By enabling parse options, you can reduce the amount of data processed, resulting in: * Faster load times * Lower memory usage * Smaller JSON responses These enhancements are especially beneficial for users working with large or complex Excel files, offering a more efficient and responsive experience. -> **Note:** These options are ideal when styles and number formats are not critical to your use case and the focus is on loading the actual data efficiently. +Please find the table below for available parsing options +| Option | Description | +|-------------------------|--------------------------------------------------------------------| +| `IgnoreStyle` | Skips cell styling such as font, color, borders, and alignment. | +| `IgnoreFormat` | Skips number formatting rules (e.g., currency, date formats). | +| `IgnoreFormula` | Skips formula cells and imports only the last calculated values. | +| `IgnoreValidation` | Skips data validation rules. | +| `IgnoreConditionalFormat` | Skips conditional formatting rules. | +| `IgnoreMergedCell` | Skips merged cell information. | +| `IgnoreChart` | Skips embedded chart objects. | +| `IgnoreImage` | Skips embedded images. | +--- + + **Note:** These options are ideal when styles, formats, formulas, and other visual elements are not critical to your use case and the focus is on loading the actual data efficiently. + +**Ways to Configure Parsing Option** + +You can configure parsing options in two ways: + +**1. Server-Side Configuration:** +Set the parsing options directly in the `server-side` when handling the Excel file open request. The code example below demonstrates how to configure the `IgnoreStyle` and `IgnoreFormat` parsing options on the `server-side`. **Code Snippet:** -**Server-Side Configuration:** ```csharp public IActionResult Open(IFormCollection openRequest) { @@ -324,13 +344,54 @@ public IActionResult Open(IFormCollection openRequest) ... open.ParseOptions = new WorkbookParseOptions() { IgnoreStyle = true, - IgnoreFormat = true + IgnoreFormat = true, + IgnoreFormula = true, + IgnoreValidation = true, + IgnoreConditionalFormat = true, + IgnoreMergedCell = true, + IgnoreChart = true, + IgnoreImage = true }; ... return Content(Workbook.Open(open)); } ``` +**2. Client-Side Configuration Using beforeOpen Event:** +Use the beforeOpen event in the EJ2 Spreadsheet control to pass parsing options before the file is opened. These options are then handled on the server side during deserialization. + +The code example below demonstrates how to configure parse options on the `client-side`. + +{% tabs %} +{% highlight js tabtitle="index.js" %} +{% include code-snippet/excel/spreadsheet/javascript-es5/open-save-cs9/index.js %} +{% endhighlight %} +{% highlight html tabtitle="index.html" %} +{% include code-snippet/excel/spreadsheet/javascript-es5/open-save-cs9/index.html %} +{% endhighlight %} +{% endtabs %} +{% previewsample "https://helpstaging.syncfusion.com/document-processing/code-snippet/excel/spreadsheet/javascript-es5/open-save-cs9" %} + +To receive and apply the parsing options passed from the client, add deserialization logic in the server-side open request handler + +**Code Snippet:** + +```csharp +public IActionResult Open(IFormCollection openRequest) +{ + OpenRequest open = new OpenRequest(); + ... + // Assigning the parse options to control which properties to skip while loading Excel files. + var parseOptions = openRequest["ParseOptions"]; + if (!string.IsNullOrEmpty(parseOptions)) + { + open.ParseOptions = System.Text.Json.JsonSerializer.Deserialize * Use `Ctrl + S` keyboard shortcut to save the Spreadsheet data as Excel file. @@ -762,8 +824,8 @@ The possible values are: The following list of Excel file formats are supported in Spreadsheet: -* MS Excel (.xlsx) -* MS Excel 97-2003 (.xls) +* Microsoft Excel (.xlsx) +* Microsoft Excel 97-2003 (.xls) * Comma Separated Values (.csv) * Portable Document Format (.pdf) diff --git a/Document-Processing/Excel/Spreadsheet/Javascript-ES5/performance-best-practices.md b/Document-Processing/Excel/Spreadsheet/Javascript-ES5/performance-best-practices.md index ce2c6d79c..4b4a128bd 100644 --- a/Document-Processing/Excel/Spreadsheet/Javascript-ES5/performance-best-practices.md +++ b/Document-Processing/Excel/Spreadsheet/Javascript-ES5/performance-best-practices.md @@ -77,7 +77,9 @@ public IActionResult Open(IFormCollection openRequest) ### Optimize Excel open with parsing options -To improve performance when opening large Excel files, use parsing options like `IgnoreStyle` and `IgnoreFormat` to skip unnecessary styles and formats. This reduces memory usage, speeds up loading, and minimizes JSON size—especially helpful for files with many styled but empty cells. +To improve performance when opening large Excel files, use parsing options to skip non-essential properties during import. These options help reduce memory usage, speed up loading, and minimize JSON size—especially useful for files with complex formatting or large datasets. + +By configuring the parse options, you can load Excel files into the Spreadsheet while retaining only the necessary content. This ensures efficient handling of large or high-memory files without compromising essential data. To learn how to configure these parsing options, please refer to the UG section below. * [Configure Parsing Options](./open-save#improving-excel-file-open-performance-with-parsing-options) diff --git a/Document-Processing/Excel/Spreadsheet/Javascript-ES6/open-save.md b/Document-Processing/Excel/Spreadsheet/Javascript-ES6/open-save.md index 410ba3366..ee7e9da1d 100644 --- a/Document-Processing/Excel/Spreadsheet/Javascript-ES6/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/Javascript-ES6/open-save.md @@ -39,6 +39,7 @@ Please find the below table for the beforeOpen event arguments. | file | FileList or string or File | To get the file stream. `FileList` - contains length and item index.
`File` - specifies the file lastModified and file name. | | cancel | boolean | To prevent the open operation. | | requestData | object | To provide the Form data. | +| parseOptions | WorkbookParseOptions | Specifies options to control how the Excel file is loaded. You can skip specific properties to optimize performance. | > * Use `Ctrl + O` keyboard shortcut to open Excel documents. > * The default value of the [allowOpen](https://ej2.syncfusion.com/documentation/api/spreadsheet/#allowopen) property is `true`. For demonstration purpose, we have showcased the [allowOpen](https://ej2.syncfusion.com/documentation/api/spreadsheet/#allowopen) property in previous code snippet. @@ -305,22 +306,40 @@ The following code snippet demonstrates how to configure the deserialization opt ### Improving Excel file open performance with parsing options -Opening large Excel files into the EJ2 Spreadsheet control can sometimes lead to slower performance and increased memory usage. This is often caused by the processing of additional elements such as styles and number formats—even when the actual data content is minimal. For example, an Excel file with only a small amount of data but a large number of styled or formatted empty cells can significantly impact load time and memory consumption. +Opening large Excel files into the EJ2 Spreadsheet control can sometimes lead to slower performance and increased memory usage. This is often caused by the processing of additional elements such as styles, number formats, formulas, validations, conditional formats, merged cells, charts, and images—even when the actual data content is minimal. For example, an Excel file with only a small amount of data but a large number of styled or formatted empty cells can significantly impact load time and memory consumption. -To address this, we've introduced parsing options that allow users to selectively skip non-essential features during the open process. By enabling options like `IgnoreStyle` and `IgnoreFormat`, you can reduce the amount of data processed, resulting in: +To address this, we've introduced parsing options that allow users to selectively skip non-essential properties during the open process. By enabling parse options, you can reduce the amount of data processed, resulting in: * Faster load times * Lower memory usage * Smaller JSON responses These enhancements are especially beneficial for users working with large or complex Excel files, offering a more efficient and responsive experience. -> **Note:** These options are ideal when styles and number formats are not critical to your use case and the focus is on loading the actual data efficiently. +Please find the table below for available parsing options +| Option | Description | +|-------------------------|--------------------------------------------------------------------| +| `IgnoreStyle` | Skips cell styling such as font, color, borders, and alignment. | +| `IgnoreFormat` | Skips number formatting rules (e.g., currency, date formats). | +| `IgnoreFormula` | Skips formula cells and imports only the last calculated values. | +| `IgnoreValidation` | Skips data validation rules. | +| `IgnoreConditionalFormat` | Skips conditional formatting rules. | +| `IgnoreMergedCell` | Skips merged cell information. | +| `IgnoreChart` | Skips embedded chart objects. | +| `IgnoreImage` | Skips embedded images. | -The code example below demonstrates how to configure the `IgnoreStyle` and `IgnoreFormat` parsing options on the `server-side`. +> **Note:** These options are ideal when styles, formats, formulas, and other visual elements are not critical to your use case and the focus is on loading the actual data efficiently. + +**Ways to Configure Parsing Option** + +You can configure parsing options in two ways: + +**1. Server-Side Configuration:** +Set the parsing options directly in the `server-side` when handling the Excel file open request. + +The code example below demonstrates how to configure parse options on the `server-side`. **Code Snippet:** -**Server-Side Configuration:** ```csharp public IActionResult Open(IFormCollection openRequest) { @@ -328,12 +347,47 @@ public IActionResult Open(IFormCollection openRequest) ... open.ParseOptions = new WorkbookParseOptions() { IgnoreStyle = true, - IgnoreFormat = true + IgnoreFormat = true, + IgnoreFormula = true, + IgnoreValidation = true, + IgnoreConditionalFormat = true, + IgnoreMergedCell = true, + IgnoreChart = true, + IgnoreImage = true }; ... return Content(Workbook.Open(open)); } ``` +**2. Client-Side Configuration Using beforeOpen Event:** +Use the beforeOpen event in the EJ2 Spreadsheet control to pass parsing options before the file is opened. These options are then handled on the server side during deserialization. +The code example below demonstrates how to configure parse options on the `client-side`. +{% tabs %} +{% highlight ts tabtitle="index.ts" %} +{% include code-snippet/excel/spreadsheet/javascript-es6/open-save-cs9/index.ts %} +{% endhighlight %} +{% highlight html tabtitle="index.html" %} +{% include code-snippet/excel/spreadsheet/javascript-es6/open-save-cs9/index.html %} +{% endhighlight %} +{% endtabs %} +{% previewsample "https://helpstaging.syncfusion.com/document-processing/code-snippet/excel/spreadsheet/javascript-es6/open-save-cs9" %} +To receive and apply the parsing options passed from the client, add deserialization logic in the server-side open request handler +**Code Snippet:** +```csharp +public IActionResult Open(IFormCollection openRequest) +{ + OpenRequest open = new OpenRequest(); + ... + // Assigning the parse options to control which properties to skip while loading Excel files. + var parseOptions = openRequest["ParseOptions"]; + if (!string.IsNullOrEmpty(parseOptions)) + { + open.ParseOptions = System.Text.Json.JsonSerializer.Deserialize * Use `Ctrl + S` keyboard shortcut to save the Spreadsheet data as Excel file. @@ -769,8 +824,8 @@ The possible values are: The following list of Excel file formats are supported in Spreadsheet: -* MS Excel (.xlsx) -* MS Excel 97-2003 (.xls) +* Microsoft Excel (.xlsx) +* Microsoft Excel 97-2003 (.xls) * Comma Separated Values (.csv) * Portable Document Format (.pdf) diff --git a/Document-Processing/Excel/Spreadsheet/Javascript-ES6/performance-best-practices.md b/Document-Processing/Excel/Spreadsheet/Javascript-ES6/performance-best-practices.md index 031537b5c..96990d508 100644 --- a/Document-Processing/Excel/Spreadsheet/Javascript-ES6/performance-best-practices.md +++ b/Document-Processing/Excel/Spreadsheet/Javascript-ES6/performance-best-practices.md @@ -77,9 +77,11 @@ public IActionResult Open(IFormCollection openRequest) ### Optimize Excel open with parsing options -To improve performance when opening large Excel files, use parsing options like `IgnoreStyle` and `IgnoreFormat` to skip unnecessary styles and formats. This reduces memory usage, speeds up loading, and minimizes JSON size—especially helpful for files with many styled but empty cells. +To improve performance when opening large Excel files, use parsing options to skip non-essential properties during import. These options help reduce memory usage, speed up loading, and minimize JSON size—especially useful for files with complex formatting or large datasets. -To learn how to configure these parsing options, please refer to the UG section below. +By configuring the parse options, you can load Excel files into the Spreadsheet while retaining only the necessary content. This ensures efficient handling of large or high-memory files without compromising essential data. + +To learn how to configure the parsing options, please refer to the UG section below. * [Configure Parsing Options](./open-save#improving-excel-file-open-performance-with-parsing-options) ## How to improve performance on formula calculation in Spreadsheet? diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/datasource.ts b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/datasource.ts new file mode 100644 index 000000000..e69de29bb diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.html b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.html new file mode 100644 index 000000000..f8a17a06a --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.html @@ -0,0 +1,21 @@ + + + + EJ2 SpreadSheet + + + + + + + + + + + +
Loading....
+
+
+
+ + \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.js b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.js new file mode 100644 index 000000000..2b17da537 --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.js @@ -0,0 +1,22 @@ +import { Spreadsheet } from '@syncfusion/ej2-spreadsheet'; + +// Initialize the Spreadsheet control +const spreadsheet = new Spreadsheet({ + allowOpen: true, + openUrl: 'https://services.syncfusion.com/js/production/api/spreadsheet/open', + beforeOpen: function(args) { + args.parseOptions = { + ignoreStyle: true, + ignoreFormat: true, + ignoreChart: true, + ignoreImage: true, + ignoreMergedCell: true, + ignoreFormula: true, + ignoreValidation: true, + ignoreConditionalFormat: true, + }; + }, +}); + +// Append the spreadsheet to the DOM +spreadsheet.appendTo('#spreadsheet'); \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.ts b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.ts new file mode 100644 index 000000000..4a809f95e --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/index.ts @@ -0,0 +1,23 @@ +// index.ts +import { Spreadsheet, BeforeOpenEventArgs } from '@syncfusion/ej2-spreadsheet'; + +// Initialize the Spreadsheet control +const spreadsheet: Spreadsheet = new Spreadsheet({ + allowOpen: true, + openUrl: 'https://services.syncfusion.com/js/production/api/spreadsheet/open', + beforeOpen: (args: BeforeOpenEventArgs): void => { + args.parseOptions = { + ignoreStyle: true, + ignoreFormat: true, + ignoreChart: true, + ignoreImage: true, + ignoreMergedCell: true, + ignoreFormula: true, + ignoreValidation: true, + ignoreConditionalFormat: true, + }; + }, +}); + +// Append the spreadsheet to the DOM +spreadsheet.appendTo('#spreadsheet'); \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/styles.css b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/styles.css new file mode 100644 index 000000000..b76f10745 --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/styles.css @@ -0,0 +1,12 @@ +#loader { + color: #008cff; + height: 40px; + left: 45%; + position: absolute; + top: 45%; + width: 30%; +} + +body { + overflow: hidden; +} \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/system.config.js b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/system.config.js new file mode 100644 index 000000000..48488c804 --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES5/open-save-cs9/system.config.js @@ -0,0 +1,47 @@ +System.config({ + transpiler: "typescript", + typescriptOptions: { + compilerOptions: { + target: "umd", + module: "commonjs", + moduleResolution: "node", + emitDecoratorMetadata: true, + experimentalDecorators: true + } + }, + paths: { + "syncfusion:": "https://cdn.syncfusion.com/ej2/23.1.36/" + }, + map: { + main: "index.ts", + typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js", + //Syncfusion packages mapping + "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js", + "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js", + "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js", + "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js", + "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js", + "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js", + "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js", + "@syncfusion/ej2-notifications": "syncfusion:ej2-notifications/dist/ej2-notifications.umd.min.js", + "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js", + "@syncfusion/ej2-dropdowns": "syncfusion:ej2-dropdowns/dist/ej2-dropdowns.umd.min.js", + "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js", + "@syncfusion/ej2-excel-export": "syncfusion:ej2-excel-export/dist/ej2-excel-export.umd.min.js", + "@syncfusion/ej2-pdf-export": "syncfusion:ej2-pdf-export/dist/ej2-pdf-export.umd.min.js", + "@syncfusion/ej2-file-utils": "syncfusion:ej2-file-utils/dist/ej2-file-utils.umd.min.js", + "@syncfusion/ej2-compression": "syncfusion:ej2-compression/dist/ej2-compression.umd.min.js", + "@syncfusion/ej2-grids": "syncfusion:ej2-grids/dist/ej2-grids.umd.min.js", + "@syncfusion/ej2-charts": "syncfusion:ej2-charts/dist/ej2-charts.umd.min.js", + "@syncfusion/ej2-svg-base": "syncfusion:ej2-svg-base/dist/ej2-svg-base.umd.min.js", + "@syncfusion/ej2-spreadsheet": "syncfusion:ej2-spreadsheet/dist/ej2-spreadsheet.umd.min.js" + } +}); + +System.import('index.ts').catch(console.error.bind(console)).then(function () { + // Optional: Hide loader and show container after app loads + const loader = document.getElementById('loader'); + const container = document.getElementById('container'); + if (loader) loader.style.display = "none"; + if (container) container.style.visibility = "visible"; +}); \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/datasource.ts b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/datasource.ts new file mode 100644 index 000000000..e69de29bb diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.html b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.html new file mode 100644 index 000000000..f8a17a06a --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.html @@ -0,0 +1,21 @@ + + + + EJ2 SpreadSheet + + + + + + + + + + + +
Loading....
+
+
+
+ + \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.js b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.js new file mode 100644 index 000000000..2b17da537 --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.js @@ -0,0 +1,22 @@ +import { Spreadsheet } from '@syncfusion/ej2-spreadsheet'; + +// Initialize the Spreadsheet control +const spreadsheet = new Spreadsheet({ + allowOpen: true, + openUrl: 'https://services.syncfusion.com/js/production/api/spreadsheet/open', + beforeOpen: function(args) { + args.parseOptions = { + ignoreStyle: true, + ignoreFormat: true, + ignoreChart: true, + ignoreImage: true, + ignoreMergedCell: true, + ignoreFormula: true, + ignoreValidation: true, + ignoreConditionalFormat: true, + }; + }, +}); + +// Append the spreadsheet to the DOM +spreadsheet.appendTo('#spreadsheet'); \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.ts b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.ts new file mode 100644 index 000000000..4a809f95e --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/index.ts @@ -0,0 +1,23 @@ +// index.ts +import { Spreadsheet, BeforeOpenEventArgs } from '@syncfusion/ej2-spreadsheet'; + +// Initialize the Spreadsheet control +const spreadsheet: Spreadsheet = new Spreadsheet({ + allowOpen: true, + openUrl: 'https://services.syncfusion.com/js/production/api/spreadsheet/open', + beforeOpen: (args: BeforeOpenEventArgs): void => { + args.parseOptions = { + ignoreStyle: true, + ignoreFormat: true, + ignoreChart: true, + ignoreImage: true, + ignoreMergedCell: true, + ignoreFormula: true, + ignoreValidation: true, + ignoreConditionalFormat: true, + }; + }, +}); + +// Append the spreadsheet to the DOM +spreadsheet.appendTo('#spreadsheet'); \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/styles.css b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/styles.css new file mode 100644 index 000000000..b76f10745 --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/styles.css @@ -0,0 +1,12 @@ +#loader { + color: #008cff; + height: 40px; + left: 45%; + position: absolute; + top: 45%; + width: 30%; +} + +body { + overflow: hidden; +} \ No newline at end of file diff --git a/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/system.config.js b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/system.config.js new file mode 100644 index 000000000..48488c804 --- /dev/null +++ b/Document-Processing/code-snippet/Excel/Spreadsheet/Javascript-ES6/open-save-cs9/system.config.js @@ -0,0 +1,47 @@ +System.config({ + transpiler: "typescript", + typescriptOptions: { + compilerOptions: { + target: "umd", + module: "commonjs", + moduleResolution: "node", + emitDecoratorMetadata: true, + experimentalDecorators: true + } + }, + paths: { + "syncfusion:": "https://cdn.syncfusion.com/ej2/23.1.36/" + }, + map: { + main: "index.ts", + typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js", + //Syncfusion packages mapping + "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js", + "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js", + "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js", + "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js", + "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js", + "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js", + "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js", + "@syncfusion/ej2-notifications": "syncfusion:ej2-notifications/dist/ej2-notifications.umd.min.js", + "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js", + "@syncfusion/ej2-dropdowns": "syncfusion:ej2-dropdowns/dist/ej2-dropdowns.umd.min.js", + "@syncfusion/ej2-calendars": "syncfusion:ej2-calendars/dist/ej2-calendars.umd.min.js", + "@syncfusion/ej2-excel-export": "syncfusion:ej2-excel-export/dist/ej2-excel-export.umd.min.js", + "@syncfusion/ej2-pdf-export": "syncfusion:ej2-pdf-export/dist/ej2-pdf-export.umd.min.js", + "@syncfusion/ej2-file-utils": "syncfusion:ej2-file-utils/dist/ej2-file-utils.umd.min.js", + "@syncfusion/ej2-compression": "syncfusion:ej2-compression/dist/ej2-compression.umd.min.js", + "@syncfusion/ej2-grids": "syncfusion:ej2-grids/dist/ej2-grids.umd.min.js", + "@syncfusion/ej2-charts": "syncfusion:ej2-charts/dist/ej2-charts.umd.min.js", + "@syncfusion/ej2-svg-base": "syncfusion:ej2-svg-base/dist/ej2-svg-base.umd.min.js", + "@syncfusion/ej2-spreadsheet": "syncfusion:ej2-spreadsheet/dist/ej2-spreadsheet.umd.min.js" + } +}); + +System.import('index.ts').catch(console.error.bind(console)).then(function () { + // Optional: Hide loader and show container after app loads + const loader = document.getElementById('loader'); + const container = document.getElementById('container'); + if (loader) loader.style.display = "none"; + if (container) container.style.visibility = "visible"; +}); \ No newline at end of file