function getViewer() {
if (viewer && viewer.destroy) {
viewer.destroy();
viewer = null;
}
viewer = GrapeCity.ActiveReports.Viewer({
element: '#viewer',
reportService: {
url: "~/Service/VM/EvcDataPackage.ReportService.asmx"
},
uiType: isPC() ? 'desktop' : 'mobile',
availableExports: ["df", "Word", "Image", "Xls"],
reportLoaded: function () {
},
documentLoaded: function () {
$("#BtnSearch").removeAttr("disabled");
$("#BtnSearch").html('<i class="fa fa-search"></i>查 询');
$("#BtnSearch").css("cursor", "pointer");
},
error: function (error) {
console.log("error");
}
});
return viewer;
}
var _rpt = "Reports/VM/原始数据包查询.rdlx";
var reportsButtons = $('#BtnSearch');
reportsButtons.bind('click', function (ev) {
ev.stopImmediatePropagation();
var target = $(ev.target);
var reportOption = {
id: _rpt,
parameters: [
{ name: 'KeyValue', value: $("#KeyValue").val() },
{ name: 'BeginTime', value: $("#sAppDate").val() },
{ name: 'EndTime', value: $("#eAppDate").val() },
{ name: 'OrderByDesc', value: $('#hideSortWay').val() },
{ name: 'InputDesc', value: $('#InputDesc').val() },
{ name: 'Type', value: $('#hideType').val() }
]
};
$("#BtnSearch").attr("disabled", "disabled");
$("#BtnSearch").html('<i class="fa fa-search"></i>查询中');
$("#BtnSearch").css("cursor", "default");
getViewer().option('report', reportOption);
});
后台:
protected override object OnCreateReportHandler(string reportPath)
{
switch (reportPath)
{
case "Reports/VM/原始数据包查询.rdlx":
PageReport definition1 = (PageReport)base.OnCreateReportHandler("Reports/VM/原始数据包查询.rdlx");
definition1.Document.LocateDataSource += new LocateDataSourceEventHandler(InitDataSource);
return definition1;
default:
return base.OnCreateReportHandler(reportPath);
}
}
base.Context.Request["BeginTime"]; 取不到值 |
|