如何在一个MVC项目中集成Tibco报告

时间:2015-12-16 06:57:28

标签: integration tibco spotfire

如果我们在tibco中创建了一个简单的.dxp文件,我们想在网页上显示这个文件,那么我们该如何做呢?是否有人可以提供样本项目来执行此操作?该应用程序必须在MVC中。

提前致谢

2 个答案:

答案 0 :(得分:1)

在Tibco网站上,您将找到如何将Tibco Spotfire Webplayer嵌入HTML页面的示例。还有关于如何处理Tibco Spotfire Webplayer与HTML页面之间的通信的信息。

示例如下:http://stn.spotfire.com/stn/Tasks/IntegratingWithWebPlayer.aspx http://stn.spotfire.com/stn/Tutorials/HowToControlWebPlayer.aspx

这是官方的Tibco网站,但你会发现其他使用谷歌搜索。 :)

答案 1 :(得分:0)

不确定.Net MVC,因为我没有特别测试过MVC。要在普通html页面中打开Spotfire报告,请使用以下代码并设置错误事件以识别错误。

<div id="AppDiv" style="height:1000px;">
</div>

 <script type="text/javascript" src="http://yourserver/spotfire/wp/GetJavaScriptApi.ashx?Version=7.5"></script>

 <script>
 window.onload = function () {

   var customisation = new spotfire.webPlayer.Customization();
   customisation.showTopHeader = true;
   customisation.showToolBar = true;
   customisation.showExportFile = true;
   customisation.showExportVisualization = true;
   customisation.showCustomizableHeader = true;
   customisation.showPageNavigation = true;
   customisation.showStatusBar = true;
   customisation.showDodPanel = true;
   customisation.showFilterPanel = true;

   // create a web player variable which is needed to actually open and load your spotfire project into a web page
     var webPlayer = new spotfire.webPlayer.Application("https://myserver/spotfire/wp", customisation); // point it to the spotfire web player library and supply the customisation to it

     // now load the web player into your web page
     webPlayer.open(
       '/path/Analysis/xyz', // the path to your project in the Spotfire library
       'AppDiv', // this is the div tag in your HTML page you want to the web player to appear inside
        null // this last option is for if you need to pass your web player parameters for a parameterised information link
     );
     webPlayer.onError(errorCallback); //Register an error handler to catch errors
     webPlayer.onOpened(onOpenedCallback); //Register event handler for document opened event
     webPlayer.onClosed(onDocumentClosedCallback); //Register event handler for document closed event

     function errorCallback(errorCode, description) { alert(errorCode + ": " + description); } //Displays an error message

     function onOpenedCallback(analysisDocument) { } //Document is now opened and ready for interactions

     function onDocumentClosedCallback(analysisPath) { } //Document is now closed
 }

参考:http://www.bearonspotfire.com/how-to-embed-the-spotfire-web-player-inside-a-web-page

您还可以查看此视频,了解有关实施的正确答案。 https://www.youtube.com/watch?v=wm863bw3XCw