还是不行
我的代码如下:
@{
var reportId = ViewBag.Id == null ? "" : ViewBag.Id;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>报表设计</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!-- For Virtual Directory -->
@* <base href="/mtreport/"> *@
<style>
body, html {
width: 100%;
height: 100%;
margin: 0;
padding: 0
}
@@keyframes arwd-loader {
from {
color: #fff
}
to {
color: #0092ff
}
}
.ar-web-designer {
width: 100%;
height: 100%
}
.ar-web-designer__loader {
display: flex;
width: 100%;
height: 100%;
background-color: #0092ff;
color: #fff;
font-size: 18px;
animation-name: arwd-loader;
animation-duration: .62s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-direction: alternate;
justify-content: center;
align-items: center
}
</style>
<link rel="stylesheet" href="~/vendor/css/fonts-googleapis.css" type="text/css" />
<link rel="stylesheet" href="~/jsViewer.min.css" />
<link rel="stylesheet" href="~/web-designer.css" />
<link rel="icon" type="image/png" sizes="32x32" href="~/icons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="~/icons/favicon-16x16.png" />
<link rel="shortcut icon" href="~/icons/favicon.ico" />
</head>
<body>
<script src="~/jsViewer.min.js"></script>
<script src="~/web-designer.js"></script>
<div id="ar-web-designer" class="ar-web-designer">
<span class="ar-web-designer__loader"><b>报表设计</b></span>
</div>
<script>
var viewer = null;
GrapeCity.ActiveReports.Designer.create('#ar-web-designer', {
rpx: { enabled: true },
appBar: { openButton: { visible: true } },
// server: {
// url: 'mtreport',
// onBeforeRequest: (init) => {
// init.headers.token = "token";
// return init;
// }
// },
data: { dataSets: { canModify: true }, dataSources: { canModify: true } },
preview: {
openViewer: (options) => {
if (viewer) {
viewer.openReport(options.documentInfo.id);
return;
}
viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#' + options.element,
renderFormat: 'svg',
reportService: {
url: 'api/reporting',
},
reportID: options.documentInfo.id,
settings: {
zoomType: 'FitPage',
},
});
}
}
});
</script>
</body>
</html>
|