Skip to content

Commit 67fddb3

Browse files
Merge pull request #3118 from Syncfusion-Content/hotfix/hotfix-v26.1.35
DOCINFRA-2341_merged_using_automation
2 parents ca1dfdd + 379ace3 commit 67fddb3

33 files changed

+1251
-7
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
public IActionResult Open(IFormCollection openRequest)
2+
{
3+
OpenRequest open = new OpenRequest();
4+
open.File = openRequest.Files[0];
5+
return Content(Workbook.Open(open));
6+
}
7+
8+
public void Save(SaveSettings saveSettings)
9+
{
10+
Workbook.Save(saveSettings);
11+
}
12+
13+
public IActionResult Index()
14+
{
15+
List<object> defaultData = new List<object>()
16+
{
17+
new { Item Name= "Casual Shoes", Date= "02/14/2014", Time= "11=34=32 AM", Quantity= "10", Price= "20", Amount= "200", Discount= "1", Profit= "10" },
18+
new { Item Name= "Sports Shoes", Date= "06/11/2014", Time= "05=56=32 AM", Quantity= "20", Price= "30", Amount= "600", Discount= "5", Profit= "50" },
19+
new { Item Name= "Formal Shoes", Date= "07/27/2014", Time= "03=32=44 AM", Quantity= "20", Price= "15", Amount= "300", Discount= "7", Profit= "27" },
20+
new { Item Name= "Sandals & Floaters", Date= "11/21/2014", Time= "06=23=54 AM", Quantity= "15", Price= "20", Amount= "300", Discount= "11", Profit= "67" },
21+
new { Item Name= "Flip- Flops & Slippers", Date= "06/23/2014", Time= "12=43=59 AM", Quantity= "30", Price= "10", Amount= "300", Discount= "10", Profit= "70" },
22+
new { Item Name= "Sneakers", Date= "07/22/2014", Time= "10=55=53 AM", Quantity= "40", Price= "20", Amount= "800", Discount= "13", Profit= "66" },
23+
new { Item Name= "Running Shoes", Date= "02/04/2014", Time= "03=44=34 AM", Quantity= "20", Price= "10", Amount= "200", Discount= "3", Profit= "14" },
24+
new { Item Name= "Loafers", Date= "11/30/2014", Time= "03=12=52 AM", Quantity= "31", Price= "10", Amount= "310", Discount= "6", Profit= "29" },
25+
new { Item Name= "Cricket Shoes", Date= "07/09/2014", Time= "11=32=14 AM", Quantity= "41", Price= "30", Amount= "1210", Discount= "12", Profit= "166" },
26+
new { Item Name= "T-Shirts", Date= "10/31/2014", Time= "12=01=44 AM", Quantity= "50", Price= "10", Amount= "500", Discount= "9", Profit= "55" }
27+
};
28+
ViewBag.DefaultData = data;
29+
return View();
30+
31+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@Html.EJS().Spreadsheet("spreadsheet").OpenUrl("Open").AllowOpen(true).SaveUrl("Save").AllowSave(true).Created("created").Sheets(sheet =>
2+
{
3+
sheet.Name("Price Details").Ranges(ranges =>
4+
{
5+
ranges.DataSource((IEnumerable<object>)ViewBag.DefaultData).Add();
6+
}).Add();
7+
}).Render()
8+
9+
< script >
10+
11+
function created() {
12+
this.cellFormat({ fontWeight: 'bold', textAlign: 'center' }, 'A1:H1');
13+
this.cellFormat({ verticalAlign: 'middle' }, 'A1:H1');
14+
}
15+
16+
</ script >
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<ejs-spreadsheet id="spreadsheet" created="created" openUrl="Open" allowOpen="true" saveUrl="Save" allowSave="true">
2+
<e-spreadsheet-sheets>
3+
<e-spreadsheet-sheet name="Price Details">
4+
<e-spreadsheet-ranges>
5+
<e-spreadsheet-range dataSource="ViewBag.DefaultData"></e-spreadsheet-range>
6+
</e-spreadsheet-ranges>
7+
</e-spreadsheet-sheet>
8+
</e-spreadsheet-sheets>
9+
</ejs-spreadsheet>
10+
11+
12+
<script>
13+
14+
function created() {
15+
this.cellFormat({ fontWeight: 'bold', textAlign: 'center' }, 'A1:H1');
16+
this.cellFormat({ verticalAlign: 'middle' }, 'A1:H1');
17+
}
18+
</script>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
public IActionResult Open(IFormCollection openRequest)
2+
{
3+
OpenRequest open = new OpenRequest();
4+
open.File = openRequest.Files[0];
5+
return Content(Workbook.Open(open));
6+
}
7+
8+
public void Save(SaveSettings saveSettings)
9+
{
10+
Workbook.Save(saveSettings);
11+
}
12+
13+
public IActionResult Index()
14+
{
15+
List<object> defaultData = new List<object>()
16+
{
17+
new { Item Name= "Casual Shoes", Date= "02/14/2014", Time= "11=34=32 AM", Quantity= "10", Price= "20", Amount= "200", Discount= "1", Profit= "10" },
18+
new { Item Name= "Sports Shoes", Date= "06/11/2014", Time= "05=56=32 AM", Quantity= "20", Price= "30", Amount= "600", Discount= "5", Profit= "50" },
19+
new { Item Name= "Formal Shoes", Date= "07/27/2014", Time= "03=32=44 AM", Quantity= "20", Price= "15", Amount= "300", Discount= "7", Profit= "27" },
20+
new { Item Name= "Sandals & Floaters", Date= "11/21/2014", Time= "06=23=54 AM", Quantity= "15", Price= "20", Amount= "300", Discount= "11", Profit= "67" },
21+
new { Item Name= "Flip- Flops & Slippers", Date= "06/23/2014", Time= "12=43=59 AM", Quantity= "30", Price= "10", Amount= "300", Discount= "10", Profit= "70" },
22+
new { Item Name= "Sneakers", Date= "07/22/2014", Time= "10=55=53 AM", Quantity= "40", Price= "20", Amount= "800", Discount= "13", Profit= "66" },
23+
new { Item Name= "Running Shoes", Date= "02/04/2014", Time= "03=44=34 AM", Quantity= "20", Price= "10", Amount= "200", Discount= "3", Profit= "14" },
24+
new { Item Name= "Loafers", Date= "11/30/2014", Time= "03=12=52 AM", Quantity= "31", Price= "10", Amount= "310", Discount= "6", Profit= "29" },
25+
new { Item Name= "Cricket Shoes", Date= "07/09/2014", Time= "11=32=14 AM", Quantity= "41", Price= "30", Amount= "1210", Discount= "12", Profit= "166" },
26+
new { Item Name= "T-Shirts", Date= "10/31/2014", Time= "12=01=44 AM", Quantity= "50", Price= "10", Amount= "500", Discount= "9", Profit= "55" }
27+
};
28+
ViewBag.DefaultData = data;
29+
return View();
30+
31+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@Html.EJS().Spreadsheet("spreadsheet").OpenUrl("Open").AllowOpen(true).SaveUrl("Save").AllowSave(true).EnableNotes(false).Created("created").Sheets(sheet =>
2+
{
3+
sheet.Name("Price Details").Ranges(ranges =>
4+
{
5+
ranges.DataSource((IEnumerable<object>)ViewBag.DefaultData).Add();
6+
}).Add();
7+
}).Render()
8+
9+
< script >
10+
11+
function created() {
12+
this.cellFormat({ fontWeight: 'bold', textAlign: 'center' }, 'A1:H1');
13+
this.cellFormat({ verticalAlign: 'middle' }, 'A1:H1');
14+
}
15+
16+
</ script >
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<ejs-spreadsheet id="spreadsheet" created="created" openUrl="Open" allowOpen="true" saveUrl="Save" allowSave="true" enableNotes="false">
2+
<e-spreadsheet-sheets>
3+
<e-spreadsheet-sheet name="Price Details">
4+
<e-spreadsheet-ranges>
5+
<e-spreadsheet-range dataSource="ViewBag.DefaultData"></e-spreadsheet-range>
6+
</e-spreadsheet-ranges>
7+
</e-spreadsheet-sheet>
8+
</e-spreadsheet-sheets>
9+
</ejs-spreadsheet>
10+
11+
12+
<script>
13+
14+
function created() {
15+
this.cellFormat({ fontWeight: 'bold', textAlign: 'center' }, 'A1:H1');
16+
this.cellFormat({ verticalAlign: 'middle' }, 'A1:H1');
17+
}
18+
</script>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
public IActionResult Open(IFormCollection openRequest)
2+
{
3+
OpenRequest open = new OpenRequest();
4+
open.File = openRequest.Files[0];
5+
return Content(Workbook.Open(open));
6+
}
7+
8+
public void Save(SaveSettings saveSettings)
9+
{
10+
Workbook.Save(saveSettings);
11+
}
12+
13+
public IActionResult Index()
14+
{
15+
List<object> defaultData = new List<object>()
16+
{
17+
new { Item Name= "Casual Shoes", Date= "02/14/2014", Time= "11=34=32 AM", Quantity= "10", Price= "20", Amount= "200", Discount= "1", Profit= "10" },
18+
new { Item Name= "Sports Shoes", Date= "06/11/2014", Time= "05=56=32 AM", Quantity= "20", Price= "30", Amount= "600", Discount= "5", Profit= "50" },
19+
new { Item Name= "Formal Shoes", Date= "07/27/2014", Time= "03=32=44 AM", Quantity= "20", Price= "15", Amount= "300", Discount= "7", Profit= "27" },
20+
new { Item Name= "Sandals & Floaters", Date= "11/21/2014", Time= "06=23=54 AM", Quantity= "15", Price= "20", Amount= "300", Discount= "11", Profit= "67" },
21+
new { Item Name= "Flip- Flops & Slippers", Date= "06/23/2014", Time= "12=43=59 AM", Quantity= "30", Price= "10", Amount= "300", Discount= "10", Profit= "70" },
22+
new { Item Name= "Sneakers", Date= "07/22/2014", Time= "10=55=53 AM", Quantity= "40", Price= "20", Amount= "800", Discount= "13", Profit= "66" },
23+
new { Item Name= "Running Shoes", Date= "02/04/2014", Time= "03=44=34 AM", Quantity= "20", Price= "10", Amount= "200", Discount= "3", Profit= "14" },
24+
new { Item Name= "Loafers", Date= "11/30/2014", Time= "03=12=52 AM", Quantity= "31", Price= "10", Amount= "310", Discount= "6", Profit= "29" },
25+
new { Item Name= "Cricket Shoes", Date= "07/09/2014", Time= "11=32=14 AM", Quantity= "41", Price= "30", Amount= "1210", Discount= "12", Profit= "166" },
26+
new { Item Name= "T-Shirts", Date= "10/31/2014", Time= "12=01=44 AM", Quantity= "50", Price= "10", Amount= "500", Discount= "9", Profit= "55" }
27+
};
28+
ViewBag.DefaultData = data;
29+
return View();
30+
31+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@Html.EJS().Spreadsheet("spreadsheet").OpenUrl("Open").AllowOpen(true).SaveUrl("Save").AllowSave(true).Created("created").Sheets(sheet =>
2+
{
3+
sheet.Name("Price Details").Ranges(ranges =>
4+
{
5+
ranges.DataSource((IEnumerable<object>)ViewBag.DefaultData).Add();
6+
}).Rows(row =>
7+
{
8+
row.Index(2).Cells(cell =>
9+
{
10+
cell.Index(0).Notes("These shoes have the highest sales in terms of quantity this month.").Add();
11+
}).Add();
12+
row.Index(5).Cells(cell =>
13+
{
14+
cell.Index(0).Notes("These shoes have been the most profitable this month.").Add();
15+
}).Add();
16+
}).Columns(column => {
17+
column.Width(130).Add();
18+
column.Width(100).Add();
19+
column.Width(100).Add();
20+
}).Add();
21+
}).Render()
22+
23+
< script >
24+
25+
function created() {
26+
this.cellFormat({ fontWeight: 'bold', textAlign: 'center' }, 'A1:H1');
27+
this.cellFormat({ verticalAlign: 'middle' }, 'A1:H1');
28+
}
29+
30+
</ script >
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<ejs-spreadsheet id="spreadsheet" created="created" openUrl="Open" allowOpen="true" saveUrl="Save" allowSave="true">
2+
<e-spreadsheet-sheets>
3+
<e-spreadsheet-sheet name="Price Details">
4+
<e-spreadsheet-ranges>
5+
<e-spreadsheet-range dataSource="ViewBag.DefaultData"></e-spreadsheet-range>
6+
</e-spreadsheet-ranges>
7+
<e-spreadsheet-rows>
8+
<e-spreadsheet-row index="2">
9+
<e-spreadsheet-cells>
10+
<e-spreadsheet-cell index="0"
11+
notes="These shoes have the highest sales in terms of quantity this month."></e-spreadsheet-cell>
12+
</e-spreadsheet-cells>
13+
</e-spreadsheet-row>
14+
<e-spreadsheet-row index="5">
15+
<e-spreadsheet-cells>
16+
<e-spreadsheet-cell index="0"
17+
notes="These shoes have been the most profitable this month."></e-spreadsheet-cell>
18+
</e-spreadsheet-cells>
19+
</e-spreadsheet-row>
20+
</e-spreadsheet-rows>
21+
<e-spreadsheet-columns>
22+
<e-spreadsheet-column width="130"></e-spreadsheet-column>
23+
<e-spreadsheet-column width="100"></e-spreadsheet-column>
24+
<e-spreadsheet-column width="100"></e-spreadsheet-column>
25+
</e-spreadsheet-columns>
26+
</e-spreadsheet-sheet>
27+
</e-spreadsheet-sheets>
28+
</ejs-spreadsheet>
29+
30+
31+
<script>
32+
33+
function created() {
34+
this.cellFormat({ fontWeight: 'bold', textAlign: 'center' }, 'A1:H1');
35+
this.cellFormat({ verticalAlign: 'middle' }, 'A1:H1');
36+
}
37+
</script>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
public IActionResult Open(IFormCollection openRequest)
2+
{
3+
OpenRequest open = new OpenRequest();
4+
open.File = openRequest.Files[0];
5+
return Content(Workbook.Open(open));
6+
}
7+
8+
public void Save(IList<IFormFile> UploadFiles)
9+
{
10+
long size = 0;
11+
try
12+
{
13+
foreach (var file in UploadFiles)
14+
{
15+
var filename = ContentDispositionHeaderValue
16+
.Parse(file.ContentDisposition)
17+
.FileName
18+
.Trim('"');
19+
filename = hostingEnv.WebRootPath + $@"\{filename}";
20+
size += file.Length;
21+
if (!System.IO.File.Exists(filename))
22+
{
23+
using (FileStream fs = System.IO.File.Create(filename))
24+
{
25+
//file.CopyTo(fs);
26+
//fs.Flush();
27+
}
28+
}
29+
else
30+
{
31+
using (FileStream fs = System.IO.File.Open(filename, FileMode.Append))
32+
{
33+
//file.CopyTo(fs);
34+
//fs.Flush();
35+
}
36+
}
37+
}
38+
}
39+
catch (Exception e)
40+
{
41+
Response.Clear();
42+
Response.StatusCode = 204;
43+
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = "File failed to upload";
44+
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = e.Message;
45+
}
46+
}
47+
48+
49+
public void Remove(string UploadFile)
50+
{
51+
try
52+
{
53+
var filename = hostingEnv.WebRootPath + $@"\{UploadFile}";
54+
if (System.IO.File.Exists(filename))
55+
{
56+
System.IO.File.Delete(filename);
57+
}
58+
}
59+
catch (Exception e)
60+
{
61+
Response.Clear();
62+
Response.StatusCode = 200;
63+
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = "File removed successfully";
64+
Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = e.Message;
65+
}
66+
}

0 commit comments

Comments
 (0)