我正在开发一个适用于iPad的小型WebApp,用于向SSRS的用户显示报告。我知道有像MobiWave这样的现有解决方案,但我的客户要求我开发一个更适合他环境的解决方案。
所以我的问题如下。我正在将 SSRS 的内容加载到 iFrame 中,并将其呈现给用户。现在,当我单击链接时,行为如下。在Chrome和Safari Mobile(在iPad上)中,该网站按预期工作。当我运行与 Web 应用程序相同的站点时,链接将在新的 safari 窗口中打开。我尝试了许多这样的解决方案,但我没有让它按预期工作。
我的代码如下:
<!DOCTYPE html>
<html>
<head>
<title> TEST </title>
<link rel="stylesheet" href="css/jquery.mobile-1.1.1.min.css" />
<link rel="stylesheet" href="css/style.css" />
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jquery.mobile-1.1.1.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
<link rel="apple-touch-icon" sizes="72x72" href="images/touch-icon-ipad.png" />
<link rel="apple-touch-startup-image" href="images/startup.png">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head>
<body>
<div data-role="page" id="home">
<div data-role="header">
<ul data-role="controlgroup" data-type="horizontal" class="localnav">
<li><a data-role="button" data-rel="back" data-icon="arrow-l">Back</a></li>
<li><a href="./" data-role="button" data-icon="home" data-ajax="false">Home</a></li>
</ul>
</div>
<div id="content" data-role="content">
<iframe src="../ReportServer"></iframe>
</div>
</div>
</body>
</html>
编辑
加载到 iFrame 的代码如下:
<html>
<head>
<meta name="Generator" content="Microsoft SQL Server Reporting Services, Version 10.50.1600.1">
<title>localhost/ReportServer - /Reportings</title>
</head>
<body><H1>localhost/ReportServer - /Reportings</H1><hr>
<pre>
<A HREF="http://localhost/ReportServer?&rs%3ACommand=ListChildren">[In übergeordnetes Verzeichnis]</A>
Donnerstag, 13. September 2012 15:16 39033 <A HREF="?%2fReportings%2fReport1&rs:Command=Render">Report1</A>
</pre>
<hr>
Microsoft SQL Server Reporting Services, Version 10.50.1600.1
</body>
</html>
哪些链接正在打开新选项卡、JQM 导航或报告服务报告内容?您的报表是作为完整的报表服务网站 UI 加载的,还是直接链接到报表的报表服务器基本呈现?
如果链接到报表的报表服务器版本,则一个回退可能是呈现为 PDF 而不是 HTML。
考虑删除对jQuery Mobile的依赖,因为它会干扰正常的页面/点击事件。如果您计划构建更大的移动应用程序并且遇到jQM兼容性问题,您可能还需要查看其他替代移动框架:
- http://enyojs.com/
- http://www.sencha.com/products/touch
- http://www.kendoui.com/mobile.aspx