<script language="javascript" type="text/javascript">
var exportSelect = '<select id="ExportSelect" style="width:80px"><option selected disabled>Export</option><option value="PDF" style="background: url(images/pdf.png) right no-repeat; width: 50px">PDF</option><option value="Excel" style="background: url(images/Excel.gif) right no-repeat; width: 50px">Excel</option></select>';
$(document).ready(function () {
$(".arvToolBar").append(exportSelect);
$("#ExportSelect").change(function (e, args) {
var viewModel = GetViewModel("WebViewer1");
var valueSelected = this.value;
if (viewModel.PageLoaded()) {
switch (valueSelected) {
case "PDF":
viewModel.Export(ExportType.Pdf, function (uri) {
window.location = uri;
}, true);
break;
case "Excel":
viewModel.Export(ExportType.Xls, function (uri) {
window.location = uri;
}, true,
{ FileName: 'Test1', MultiSheet: true });//导出属性的设置
break;
}
}
});
});
</script><span style="color: black; font-family: 新宋体; font-size: 9.5pt; background-color: rgb(255, 255, 255);"> </span>
|
|