通过 URL访问ReportingService报表
2006-03-23 08:29
295 查看
Reporting Service允许使用url传递相关参数,并打开报表,我试验了一下,可以通过多种rul方式访问这些报表,我现在常用的有两种:
第一种,我是通过查看最终报表属性中的链接推算出来的:
public string GetReportUrl(string strUserID,string BeginDate,string EndDate,string strFolderRoot,string strFolder1,string ReportName )
{
Reports myRp =new Reports();
string strUrl="";
strFolderRoot=myRp.StrToHex(strFolderRoot);
strFolder1=myRp.StrToHex(strFolder1);
ReportName=myRp.StrToHex(ReportName);
//服务器的名称/reportserver?
strUrl=@"http://oareport.test.net/ReportServer?%2f"+strFolderRoot+"%2f"+strFolder1+"%2f"+ReportName+"&";
strUrl=strUrl+"BeginDate="+BeginDate+"&EndDate="+EndDate+
"&UserID="+strUserID+
"&rs%3aClearSession=true&rs%3aCommand=Render&rs%3aFormat=HTML4.0"+
"&rc%3aReplacementRoot=http%3a%2f%2f"+
"oareport.hollysys.net%2fReports%2fPages%2fReport.aspx%3fServerUrl%3d&rc%3a"+
"Toolbar=True&rc%3aJavaScript=True&rc%3aLinkTarget=_blank&rc%3aArea=Report";
return strUrl;
}
另一种是reporting Service 帮助文件中的标准用法:
&prefix:param=value[&prefix:param=value]...n]http://server/virtualroot?[/pathinfo]&prefix:param=value[&prefix:param=value]...n]
而且它还可以根据需要定制页面的格式等,详细情况帮助文件说的很明白,要用的时候参考一下那个就好了。
不过这里要注意,reporting Service 中的url中的汉字必须转换成utf编码才行,因此我的例子中用了StrToHex()这个函数,详细地内容可以参考我的另一篇文章
第一种,我是通过查看最终报表属性中的链接推算出来的:
public string GetReportUrl(string strUserID,string BeginDate,string EndDate,string strFolderRoot,string strFolder1,string ReportName )
{
Reports myRp =new Reports();
string strUrl="";
strFolderRoot=myRp.StrToHex(strFolderRoot);
strFolder1=myRp.StrToHex(strFolder1);
ReportName=myRp.StrToHex(ReportName);
//服务器的名称/reportserver?
strUrl=@"http://oareport.test.net/ReportServer?%2f"+strFolderRoot+"%2f"+strFolder1+"%2f"+ReportName+"&";
strUrl=strUrl+"BeginDate="+BeginDate+"&EndDate="+EndDate+
"&UserID="+strUserID+
"&rs%3aClearSession=true&rs%3aCommand=Render&rs%3aFormat=HTML4.0"+
"&rc%3aReplacementRoot=http%3a%2f%2f"+
"oareport.hollysys.net%2fReports%2fPages%2fReport.aspx%3fServerUrl%3d&rc%3a"+
"Toolbar=True&rc%3aJavaScript=True&rc%3aLinkTarget=_blank&rc%3aArea=Report";
return strUrl;
}
另一种是reporting Service 帮助文件中的标准用法:
&prefix:param=value[&prefix:param=value]...n]http://server/virtualroot?[/pathinfo]&prefix:param=value[&prefix:param=value]...n]
而且它还可以根据需要定制页面的格式等,详细情况帮助文件说的很明白,要用的时候参考一下那个就好了。
不过这里要注意,reporting Service 中的url中的汉字必须转换成utf编码才行,因此我的例子中用了StrToHex()这个函数,详细地内容可以参考我的另一篇文章
相关文章推荐
- 接口加密《一》:移动应用中,通过在客户端对访问的url进行加密处理来保护服务器上的数据
- java.net.URL如何通过proxy访问internet资源
- WEB-INF下的JSP是不能通过URL直接访问的
- HttpURLConnection:访问服务器端,做登录-->get请求。参数是通过url来进行传递
- 小工具-使用java SSL通过url获得访问转为String-http/https
- 网页中怎样禁止通过输入url直接访问
- WEB-INF下的JSP是不能通过URL直接访问的
- 微信公众平台申请测试接口URL和TOKEN的配置,怎么在本地让微信能通过80端口访问
- PHP安全编程:留心后门URL 直接可以通过URL访问(转)
- 在浏览器通过url测试访问axis webservice
- 通过Java访问指定url
- 通过url访问Reporting Service中的报表
- http接口加密《一》:移动应用中,通过在客户端对访问的url进行加密处理来保护服务器上的数据
- 转载 通过JAVA语言实现使用URL访问网络资源
- 通过url访问web----android 代码学习
- 利用WebResource.axd通过一个URL来访问装配件的内置资源
- python实现通过代理服务器访问远程url的方法
- 通过代理实现Java代码访问指定URL
- .net通过url访问服务器获取服务器返回数据
- 关于安卓开发当中通过java自带的HttpURLConnection访问XML的java.io.EOFException问题