You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing/Excel/Spreadsheet/React/Open-Excel-File/from-google-drive.md
+23-14Lines changed: 23 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,11 @@ Start by following the steps provided in this [link](https://help.syncfusion.com
21
21
22
22
**Step 3:** Modify the `SpreadsheetController.cs` File in the Web Service Project
23
23
24
-
1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services) for instructions on how to create a web service project.
24
+
* Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services) for instructions on how to create a web service project.
25
25
26
-
2. Open the `SpreadsheetController.cs` file in your web service project.
26
+
* Open the `SpreadsheetController.cs` file in your web service project.
27
27
28
-
3. Import the required namespaces at the top of the file:
28
+
* Import the required namespaces at the top of the file:
29
29
30
30
```csharp
31
31
@@ -36,9 +36,9 @@ using Syncfusion.EJ2.Spreadsheet;
36
36
37
37
```
38
38
39
-
4. Add the following private fields and constructor parameters to the `SpreadsheetController` class, In the constructor, assign the values from the configuration to the corresponding fields.
39
+
* Add the following private fields and constructor parameters to the `SpreadsheetController` class, In the constructor, assign the values from the configuration to the corresponding fields.
40
40
41
-
```Csharp
41
+
```csharp
42
42
43
43
//variables for storing GDrive folderId, ApplicationName and Service-Accountkey credentials
44
44
publicreadonlystringfolderId;
@@ -55,9 +55,9 @@ public SpreadsheetController(IConfiguration configuration)
55
55
56
56
```
57
57
58
-
5. Create the `OpenExcelFromGoogleDrive()` method to open the document from the Google Drive.
58
+
* Create the `OpenExcelFromGoogleDrive()` method to open the document from the Google Drive.
59
59
60
-
```Csharp
60
+
```csharp
61
61
62
62
[HttpPost]
63
63
[Route("OpenExcelFromGoogleDrive")]
@@ -128,19 +128,28 @@ public class FileOptions
128
128
129
129
```
130
130
131
-
6. Open the `appsettings.json` file in your web service project, add your Google Drive configuration details.
131
+
N> You can also refer to this [GitHub](https://github.com/SyncfusionExamples/syncfusion-react-spreadsheet-google-drive-integration/tree/master) repository for reference.
132
132
133
-
```Json
133
+
* Open the `appsettings.json` file in your web service project, add your Google Drive configuration details.
N> Replace **Your Google Drive Folder ID**, **Your Application name**, and **Your Path to the OAuth 2.0 Client IDs json file** with your actual Google drive folder ID , Your name for your application and the path for the JSON file.
152
+
N> Replace the **credential path**, **folderId** and **application name** in json file with your actual Google drive folder ID , your name for your application and the path for the JSON file.
144
153
145
154
**Step 4:** Modify the index File in the Spreadsheet sample to make a fetch call to the server to retrieve and load the Excel file from the Google Drive into the client-side spreadsheet.
Copy file name to clipboardExpand all lines: Document-Processing/Excel/Spreadsheet/React/Save-Excel-File/to-google-drive.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,11 @@ Start by following the steps provided in this [link](https://help.syncfusion.com
21
21
22
22
**Step 3:** Modify the `SpreadsheetController.cs` File in the Web Service Project
23
23
24
-
1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services) for instructions on how to create a web service project.
24
+
* Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/blogs/post/host-spreadsheet-open-and-save-services) for instructions on how to create a web service project.
25
25
26
-
2. Open the `SpreadsheetController.cs` file in your web service project.
26
+
* Open the `SpreadsheetController.cs` file in your web service project.
27
27
28
-
3. Import the required namespaces at the top of the file:
28
+
* Import the required namespaces at the top of the file:
29
29
30
30
```csharp
31
31
@@ -36,7 +36,7 @@ using Syncfusion.EJ2.Spreadsheet;
36
36
37
37
```
38
38
39
-
4. Add the following private fields and constructor parameters to the `SpreadsheetController` class, In the constructor, assign the values from the configuration to the corresponding fields.
39
+
* Add the following private fields and constructor parameters to the `SpreadsheetController` class, In the constructor, assign the values from the configuration to the corresponding fields.
40
40
41
41
```csharp
42
42
@@ -57,7 +57,7 @@ public SpreadsheetController(IConfiguration configuration)
57
57
58
58
N> Note: Change your FolderId, CredentialPath, ApplicationName with your own.
59
59
60
-
5. Create the `SaveExcelToGoogleDrive()` method to save the document to the Google Drive.
60
+
* Create the `SaveExcelToGoogleDrive()` method to save the document to the Google Drive.
61
61
62
62
```csharp
63
63
@@ -139,6 +139,8 @@ public async Task<IActionResult> SaveExcelToGoogleDrive([FromForm] SaveSettings
139
139
140
140
```
141
141
142
+
N> You can also refer to this [GitHub](https://github.com/SyncfusionExamples/syncfusion-react-spreadsheet-google-drive-integration/tree/master) repository for reference.
143
+
142
144
* Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration
143
145
144
146
```json
@@ -150,17 +152,17 @@ public async Task<IActionResult> SaveExcelToGoogleDrive([FromForm] SaveSettings
150
152
}
151
153
},
152
154
"AllowedHosts": "*",
153
-
"FolderId": "Your Google Drive Folder ID",
154
-
"CredentialPath": "Your Path to the OAuth 2.0 Client IDs json file",
N> Replace **Your Google Drive Folder ID**, **Your Application name**, and **Your Path to the OAuth 2.0 Client IDs json file** with your actual Google drive folder ID , Your name for your application and the path for the JSON file.
161
+
N> Replace the **credential path**, **folderId** and **application name** in json file with your actual Google drive folder ID , your name for your application and the path for the JSON file.
160
162
161
-
**Step 4:** Modify the index file in the Spreadsheet sample to use the [`saveAsJson`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#saveasjson) method to serialize the spreadsheet and send the JSON to the backend.
163
+
**Step 4:** Modify the index file in the Spreadsheet sample to save the file as json using the [`saveAsJson`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#saveasjson) method and send the JSON to the backend.
0 commit comments