Skip to content

Commit 7ef5078

Browse files
committed
958641: Resolved the MVC sample issue
1 parent 7fc9d14 commit 7ef5078

File tree

4 files changed

+53
-47
lines changed
  • ej2-asp-core-mvc/code-snippet/pivot-table
    • excel-export/blob-export
    • grid-customization/pdf-headercell
    • pdf-export/blob-export
    • toolbar/toolbar-export

4 files changed

+53
-47
lines changed

ej2-asp-core-mvc/code-snippet/pivot-table/excel-export/blob-export/razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
function exportComplete(args) {
2525
if (args.promise !== null) {
26-
args.promise.then((e: { blobData: Blob }) => {
26+
args.promise.then((e) => {
2727
console.log(e.blobData);
2828
});
2929
}

ej2-asp-core-mvc/code-snippet/pivot-table/grid-customization/pdf-headercell/razor

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@using Syncfusion.EJ2.PivotView
22

3+
@Html.EJS().Button("pdf").Content("Pdf Export").IsPrimary(true).Render()
4+
35
@Html.EJS().PivotView("PivotView").Height("300").DataSourceSettings(dataSourceSettings => dataSourceSettings.DataSource((IEnumerable<object>)ViewBag.DataSource).ExpandAll(false)
46
.FormatSettings(formatsettings =>
57
{
@@ -13,8 +15,14 @@
1315
}).Values(values =>
1416
{
1517
values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
16-
})).GridSettings(gridSettings => gridSettings.PdfHeaderCellInfo("pdfHeaderCell")).Render()
18+
})).GridSettings(gridSettings => gridSettings.PdfHeaderQueryCellInfo("pdfHeaderCell")).Render()
19+
1720
<script>
21+
var pivotObj;
22+
document.getElementById('pdf').onclick = function () {
23+
pivotObj = document.getElementById('PivotView').ej2_instances[0];
24+
pivotObj.pdfExport();
25+
}
1826
function pdfHeaderCell(args) {
1927

2028
}

ej2-asp-core-mvc/code-snippet/pivot-table/pdf-export/blob-export/razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
function exportComplete(args) {
2525
if (args.promise !== null) {
26-
args.promise.then((e: { blobData: Blob }) => {
26+
args.promise.then((e) => {
2727
console.log(e.blobData);
2828
});
2929
}

ej2-asp-core-mvc/code-snippet/pivot-table/toolbar/toolbar-export/razor

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -116,49 +116,47 @@
116116
}, false);
117117
}
118118
function beforeExport(args) {
119-
args.pdfExportProperties = {
120-
header: {
121-
fromTop: 0,
122-
height: 130,
123-
contents: [
124-
{
125-
type: 'Text',
126-
value: "Pivot Table",
127-
position: { x: 0, y: 50 },
128-
}
129-
]
130-
},
131-
footer: {
132-
contents: [
133-
{
134-
type: 'Text',
135-
value: "Thank You",
136-
style: { textBrushColor: '#FF0000', fontSize: 13, dashStyle: 'Solid', hAlign: 'Center' }
137-
}
138-
]
139-
}
140-
};
141-
args.excelExportProperties = {
142-
header: {
143-
headerRows: 2,
144-
rows: [
145-
{
146-
cells: [
147-
{
148-
colSpan: 4,
149-
value: 'Pivot Table',
150-
style: {
151-
fontColor: '#C67878',
152-
fontSize: 20,
153-
hAlign: 'Center',
154-
bold: true,
155-
underline: true,
156-
},
157-
},
158-
],
159-
},
160-
],
161-
},
162-
};
119+
args.excelExportProperties = {
120+
header: {
121+
headerRows: 2,
122+
rows: [
123+
{ cells: [{ colSpan: 4, value: "Pivot Table", style: { fontColor: '#C67878', fontSize: 20, hAlign: 'Center', bold: true, underline: true } }] }
124+
]
125+
},
126+
footer: {
127+
footerRows: 4,
128+
rows: [
129+
{ cells: [{ colSpan: 4, value: "Thank you for your business!", style: { hAlign: 'Center', bold: true } }] },
130+
{ cells: [{ colSpan: 4, value: "!Visit Again!", style: { hAlign: 'Center', bold: true } }] }
131+
]
132+
}
133+
};
134+
args.pdfExportProperties = {
135+
header: {
136+
fromTop: 0,
137+
height: 130,
138+
contents: [
139+
{
140+
type: 'Text',
141+
value: "Pivot Table",
142+
position: { x: 0, y: 50 },
143+
style: { textBrushColor: '#000000', fontSize: 13, dashStyle: 'Solid', hAlign: 'Center' }
144+
}
145+
]
146+
},
147+
footer: {
148+
fromBottom: 160,
149+
height: 150,
150+
contents: [
151+
{
152+
type: 'PageNumber',
153+
pageNumberType: 'Arabic',
154+
format: 'Page {$current} of {$total}',
155+
position: { x: 0, y: 25 },
156+
style: { textBrushColor: '#02007a', fontSize: 15 }
157+
}
158+
]
159+
}
160+
};
163161
}
164162
</script>

0 commit comments

Comments
 (0)