여러 검도 그리드를 하나의 Excel 파일로 내보내는 기능에 대해 문서화 된 기능은 있지만 웹 사이트에서는 각도와 일치하지 않습니다.각도로 여러 개의 검도 그리드를 내보낼 수 있음
그러나 어쩌면 누군가가 각도에 맞춰 조정할 수 있습니까?
여러 검도 그리드를 하나의 Excel 파일로 내보내는 기능에 대해 문서화 된 기능은 있지만 웹 사이트에서는 각도와 일치하지 않습니다.각도로 여러 개의 검도 그리드를 내보낼 수 있음
그러나 어쩌면 누군가가 각도에 맞춰 조정할 수 있습니까?
여러 데이터 세트를 내보낼 수 있습니다 (그리드는 각 데이터 세트에 바인딩 될 수 있지만 Excel 내보내기에는 필요하지 않습니다).
<button type="button" class="k-button" (click)="save(excelexport, excelexport1)">Export To Excel</button>
<kendo-excelexport [data]="data" fileName="Products.xlsx" #excelexport>
<kendo-excelexport-column field="ProductID" [locked]="true" title="Product ID" [width]="200">
</kendo-excelexport-column>
<kendo-excelexport-column field="ProductName" title="Product Name" [width]="350">
</kendo-excelexport-column>
<kendo-excelexport-column field="UnitPrice" title="Unit Price" [width]="120">
</kendo-excelexport-column>
</kendo-excelexport>
<kendo-excelexport [data]="data1" fileName="Products.xlsx" #excelexport1>
<kendo-excelexport-column field="ProductID" [locked]="true" title="Product ID" [width]="200">
</kendo-excelexport-column>
<kendo-excelexport-column field="ProductName" title="Product Name" [width]="350">
</kendo-excelexport-column>
<kendo-excelexport-column field="UnitPrice" title="Unit Price" [width]="120">
</kendo-excelexport-column>
</kendo-excelexport>
public save(component1, component2): void {
Promise.all([component1.workbookOptions(), component2.workbookOptions()]).then((workbooks) => {
workbooks[0].sheets = workbooks[0].sheets.concat(workbooks[1].sheets);
component1.save(workbooks[0]);
});
}
http://plnkr.co/edit/nAGrfaM2H4VK6tKIFTyP?p=preview
Excel Export documentation뿐만 아니라 유용하게 사용할 수 있습니다 예를 들면 다음과 같습니다.
그래서 kendo API를 사용하면 데이터와 매개 변수가있는 WorkbookOptions 객체를 save 메소드로 전달하기 만하면 처음부터 파일을 어셈블 할 수 있습니다.
짧은 예를 들어, JS 코드 :
public save(component): void {
const options = {
sheets: [
{
name: 'Sheet One',
filter: {
from: 0,
to: 1
},
columns: [
{
width: 100
},
{
width: 200
},
],
rows: [
{
cells: [
{
color: '#ffffff',
background: '#808080',
value: 'First name'
},
{
color: '#ffffff',
background: '#808080',
value: 'Last Name'
}
]
},
{
cells: [
{
value: 'Erick'
},
{
value: 'Carthman'
}
]
},
{
cells: [
{
value: 'Stan'
},
{
value: 'Marzh'
}
]
}
]
},
{
name: 'Sheet Two',
filter: {
from: 0,
to: 1
},
columns: [
{
width: 100
},
{
width: 200
},
],
rows: [
{
cells: [
{
color: '#ffffff',
background: '#808080',
value: 'Name'
},
{
color: '#ffffff',
background: '#808080',
value: 'Length'
}
]
},
{
cells: [
{
value: 'Vasya'
},
{
value: 10
}
]
},
{
cells: [
{
value: 'Petya'
},
{
value: 19.5
}
]
}
]
}
]
};
component.save(options);
마크 업 :
<button type="button" class="k-button" (click)="save(excelexport)">Export To Excel</button>
<kendo-excelexport fileName="Products.xlsx" #excelexport></kendo-excelexport>