SealReport的系列教程博客:https://blog.csdn.net/weixin_43224822/category_9553834.html
SealReport的系列教程一:https://blog.csdn.net/weixin_43224822/article/details/103176225
SealReport的报表没有唯一的Url可以打开指定的报表,好在官网有API,总结如下
- 把jquery.min.js和open.html放在SealReport的站点下面(跟Web.config相同目录)
- 修改open.html中的sealServer 为你的报表服务器地址
- 调用方法举例
http://localhost:8099/open.html?Test //打开Test报表
http://localhost:8099/open.html?a/b //打开a目录下面的b报表
open.html源码如下
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>启动报表</title>
<script src="jquery.min.js">
</script>
<script>
//调用方法举例1: http://localhost:8099/open.html?Test //打开Test报表
//调用方法举例2: http://localhost:8099/open.html?a/b //打开a目录下面的b报表
$(document).ready(function(){
var sealServer = "http://localhost:8099/"; //修改为报表服务地址, 新部署只需要修改这里旧可以了
var path = decodeURI(window.location.search.substr(1)) //报表名(包含路径)
var f = $('<form method="post" />').appendTo('body');
f.attr('action', sealServer + "SWExecuteReport");
f.append($('<input/>').attr('name', 'path').attr('value', '\\' + path + '.srex')); //the report path, if empty the report definition must be specified
f.children('input').attr('type', 'hidden');
f.submit();
});
</script>
</head>
<body>
<p>报表启动中......</p>
</body>
</html>