power bi报表服务器

Every once in a while, teams from different functional areas of the business (i.e. business intelligence, software development, web development etc.) would join forces to form a cross-functional development team with a common goal of integrating a business intelligence artefact such as a SQL Server Reporting Services (SSRS) report into a front-end web application. There are many reasons for forming such a partnership including a lack of report-development skill by web developers, BI team owns a better reporting tool for data visualization, or maybe to prevent the software team from “reinventing the wheel” by developing a report that has already been produced elsewhere.

每隔一段时间,来自业务不同职能领域(即商业智能,软件开发,Web开发等)的团队将联手组成一个跨职能的开发团队,其共同目标是整合诸如SQL Server Reporting Services (SSRS)报告到前端Web应用程序。 建立这种伙伴关系的原因有很多,包括Web开发人员缺乏报表开发技能,BI团队拥有更好的数据可视化报表工具,或者可能是通过开发报表来防止软件团队“重塑方向”。已经在其他地方生产了。

Regardless of the reasons for forming cross-functional teams, you would often find that whilst many tutorials have been written about the integration of Power BI Service with .Net applications, there is currently very limited content on the internet pertaining to embedding the on-prem version of Power BI Service (known as Power BI Report Server) reports into .Net applications.

无论组建跨职能团队的原因是什么,您通常会发现,尽管已经撰写了许多有关Power BI Service与.Net应用程序集成的教程,但互联网上目前有关嵌入本地内容的内容非常有限版本的Power BI服务 (称为Power BI报表服务器 )将报表导入.Net应用程序。

I was recently involved in a project that required an integration of a Power BI Report Server dashboard with an ASP.NET MVC application. As you can imagine, having so limited content on the internet relating to this type of integration meant that my team and I had to think out of the box and play around with a few ideas to get the project delivered but we managed to complete the project and, in this article, I will share my limited expertise on how you can go about embedding a Power BI Report Server reports with ASP.NET web applications.

我最近参与了一个项目,该项目需要将Power BI Report Server仪表板与ASP.NET MVC应用程序集成在一起。 可以想像,与此类集成相关的互联网内容非常有限,这意味着我和我的团队必须开箱即用,并想出一些想法来交付项目,但我们设法完成了该项目并且,在本文中,我将分享我有限的专业知识,介绍如何将Power BI Report Server报表嵌入ASP.NET Web应用程序。

将SSRS报告嵌入ASP.NET网站 (Embed SSRS Report into an ASP.NET Website)

In a way, this article is really a comparative piece between the ease at which web developers used to embed SSRS reports into their ASP.NET applications versus the challenges of doing the same thing but against a Power BI Report Server report. Thus, it is only fitting that before we proceed, we first look at how one went about integrating an SSRS report with ASP.NET applications.

从某种意义上说,本文确实是Web开发人员过去将SSRS报表嵌入其ASP.NET应用程序的难易程度与针对Power BI Report Server报表进行相同操作所面临的挑战之间的比较。 因此,在继续之前,我们首先要看看如何将SSRS报告与ASP.NET应用程序集成。

There are plenty of resources over the internet that gives you a step-by-step guideline on how to embed an SSRS report into an ASP.NET web application. Generally, the trick is twofold – (assuming that you have already developed and deployed an SSRS report):

Internet上有大量资源,可为您提供有关如何将SSRS报告嵌入ASP.NET Web应用程序的分步指南。 通常,技巧是双重的-(假设您已经开发并部署了SSRS报告):

  1. Download and Install ReportViewer Control

    下载并安装ReportViewer控件

    In order for an SSRS report to be successfully rendered in a web application, the web page must make use of the rsweb:ReportViewer element which references the assembly file Microsoft.ReportViewer.WebForms.dll. There are several ways that you can go about installing this assembly file, but the safest way would be to install it as a NuGet package.

    为了使SSRS报告能够在Web应用程序中成功呈现,网页必须使用rsweb:ReportViewer元素,该元素引用了程序集文件Microsoft.ReportViewer.WebForms.dll 。 您可以通过多种方法来安装此程序集文件,但最安全的方法是将其安装为NuGet软件包 。

  2. Create a web page to embed report

    创建网页以嵌入报告

    Once installation of the assembly file is complete, you can then embed an SSRS report into an ASP.Net page by providing details of the report’s server name, processing mode, and file location as indicated in Figure 1.

    程序集文件的安装完成后,您可以通过提供报告的服务器名称,处理模式和文件位置的详细信息,将SSRS报告嵌入到ASP.Net页中, 如图1所示

    Figure 1
    图1

    Figure 2 gives us a preview of the web page we configured in Figure 1. As it can be seen, our sample SSRS report has successfully been embedded into the Default.aspx page.

    图2提供了我们在图1中配置的网页的预览。 可以看出,我们的示例SSRS报告已成功嵌入到Default.aspx页面中。

    Figure 2
    图2

将Power BI Report Server报表嵌入ASP.NET网站 (Embedding Power BI Report Server Report into ASP.NET Website)

Although the newer version of Report Server Configuration Manager has been modified to support configuration of both SSRS Report Server and Power BI Report Server, as shown in Figure 3, the ReportViewer control continues not to support the rendering of Power BI Report Server reports.

尽管已对新版本的Report Server Configuration Manager进行了修改,以支持SSRS Report ServerPower BI Report Server的配置如图3所示,但是ReportViewer控件仍然不支持Power BI Report Server报表的呈现。

To demonstrate this limitation, I have created and successfully deployed a sample Power BI Report Server report as shown in Figure 4.

为了演示此限制,我创建并成功部署了一个示例Power BI Report Server报告, 如图4所示。

I next updated the links from my sample web application to point to my Power BI Report Server report as shown in Figure 5.

接下来,我更新了示例Web应用程序中的链接,以指向Power BI Report Server报告, 如图5所示。

This time when I run my ASP.NET web application, I receive an error message citing that an item of type Power BI Report Server report is not supported as shown in Figure 6.

这次,当我运行ASP.NET Web应用程序时,我收到一条错误消息, 指出不支持Power BI Report Server报告类型的项目, 如图6所示。

At this point, it is clear that when it comes to Power BI Report Server reports, we cannot simply reuse the same piece of code that we’ve previously turned to whenever we needed to embed an SSRS report into an ASP.Net web application. We, therefore, need to look out for other options that we can use to successfully embed reports hosted within an instance of Power BI Report Server. Fortunately, since, a Power BI Report Server report is essentially an HTML document, we have numerous HTML tags that we can use in ASP.Net application to embed a report.

至此,很明显,当涉及到Power BI Report Server报表时,无论何时需要将SSRS报表嵌入ASP.Net Web应用程序中时,我们都无法简单地重用以前使用的同一段代码。 因此,我们需要寻找可用于成功嵌入Power BI Report Server实例中托管的报表的其他选项。 幸运的是,由于Power BI Report Server报表本质上是HTML文档,因此我们可以在ASP.Net应用程序中使用许多HTML标记来嵌入报表。

选项#1:使用<iframe>标记嵌入Power BI Report Server报告 (Option #1: Embed Power BI Report Server Report using an <iframe> Tag)

Not only are iframes popular for embedding external content, they continue to be supported by major internet browsers. To demonstrate an integration of Power BI Report Server report within an iframe, I have edited the Default.aspx page of our sample web application shown in Figure 1 by replacing everything within the body tag with an iframe element that points to our sample Power BI Report Server report as shown in Figure 7.

iframe不仅因嵌入外部内容而广受欢迎,而且仍继续受到主要互联网浏览器的支持。 为了演示Power BI Report Server报告在iframe中的集成,我编辑了图1所示示例Web应用程序的Default.aspx页面,方法是将body标签中的所有内容替换为指向示例Power BI Reportiframe元素。 服务器报告如图7所示。

You will notice in Figure 7 that the link to our sample Power BI Report Server report has been suffixed with –?rs: embed=true. This is because in order for a Power BI Report Server report to be successfully embedded in your application, you need to set the rs:embed parameter to true.

您会在图7中注意到,到示例Power BI Report Server报告的链接已添加了后缀– ?rs:embed = true 。 这是因为为了将Power BI Report Server报告成功嵌入到您的应用程序中,您需要将rs:embed参数设置为true。

Figure 8 gives a preview of our web application when using an iframe. The left-hand side shows how the embedded page is rendered when the rs:embed parameter is not included in the URL whilst the right-hand side is a preview of the embedded Power BI Report Server whose URL has been suffixed with ?rs:embed=true.

图8给出了使用iframe时Web应用程序的预览。 左侧显示了URL中未包含rs:embed参数时如何呈现嵌入式页面,而右侧是URL带有后缀?rs:embed的嵌入式Power BI Report Server的预览。 = true

选项#2:使用<object>标记嵌入Power BI Report Server报告 (Option #2: Embed Power BI Report Server Report using an <object> Tag)

The object tag is usually used for displaying multimedia files within a web application. Unlike the iframe tag, the object tag might have limited browser support, especially when it comes to older versions of some browsers. Nevertheless, we can also use this HTML tag to embed a web page like a Power BI Report Server report by replacing a page’s body element with the following:

对象标记通常用于在Web应用程序中显示多媒体文件。 与iframe标签不同, 对象标签可能对浏览器的支持有限,尤其是在某些浏览器的较旧版本中。 尽管如此,我们也可以使用以下HTML标记通过将页面的body元素替换为以下内容来嵌入Web页面,如Power BI Report Server报告:

<object data=”http://win-hauseq7hanj:82/Reports/powerbi/bb?rs:embed=true”></object>

<object data =” http:// win-hauseq7hanj:82 / Reports / powerbi / bb?rs:embed = true”> </ object>

选项#3:使用<embed>标记嵌入Power BI Report Server报告 (Option #3: Embed Power BI Report Server Report using an <embed> Tag)

The embed tag is also famous for rendering multimedia files but unlike the object tag, it has far fewer attributes that you can set on your own. For the purposes of embedding a Power BI Report Server report, we only need to set the src attribute as shown below:

embed标签还以呈现多媒体文件而闻名,但是与object标签不同,它具有更少的属性,您可以自行设置。 为了嵌入Power BI Report Server报表,我们只需要设置src属性,如下所示:

<embed src=”http://win-hauseq7hanj:82/Reports/powerbi/bb?rs:embed=true”/>

<embed src =” http:// win-hauseq7hanj:82 / Reports / powerbi / bb?rs:embed = true” />

在Power BI报表服务器中隐藏筛选器面板 (Hide Filter Panel in Power BI Report Server)

The Power BI Report Server gives great comfort to organizations who are still reluctant to hosting their reports in the cloud. However, this version of Power BI doesn’t have similar features as its cloud-based counterpart. One missing feature is the ability to hide the filter panel button in your embedded report. Whilst the cloud implementation of this feature can be done by simply specifying query parameter &filterPaneEnabled=false, you need to play around with Cascading Style Sheets (CSS) to get this working against a Power BI Report Server report. The CSS workaround involves making the iframe that you will be using for embedding the report to being a responsive iframe. I’ve seen several sample scripts online about doing this, but the one that worked for me is from here, which basically involves defining your style sheet as shown below:

Power BI Report Server为仍然不愿在云中托管报告的组织提供了极大的舒适感。 但是,此版本的Power BI没有与基于云的版本相似的功能。 一种缺少的功能是能够在嵌入式报表中隐藏筛选器面板按钮的功能。 尽管可以通过简单地指定查询参数&filterPaneEnabled = false来完成此功能的云实现,但是您需要使用级联样式表 (CSS)才能使它针对Power BI Report Server报表起作用。 CSS解决方法涉及将要用于将报表嵌入到报表中的iframe变为自适应iframe。 我已经在网上看到了几个有关此操作的示例脚本,但是对我有用的一个是从这里开始的 ,它基本上涉及到定义样式表,如下所示:

    <style>        #itemshield {position: relative;float: right;width: 34px;height: 750px;background: #eaeaea;}.panel {position: relative;height: 0;overflow: hidden;}.panelcontainer {padding-bottom: 56.25%;}.panel iframe {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: white;}</style>

Then you need to wrap your iframe within div tags, as shown below:

然后,您需要将iframe包装在div标签中,如下所示:

<body>       <div class="panel panelcontainer"><iframe src="http://win-hauseq7hanj:82/Reports/powerbi/bb?rs:embed=true"></iframe><div id="itemshield"></div><div style="clear:both;"></div></div>
</body>

When you next run your web app, you will notice that the filter panel has been removed as shown in Figure 9.

下次运行Web应用程序时,您会注意到过滤器面板已被删除, 如图9所示。

翻译自: https://www.sqlshack.com/how-to-embed-a-power-bi-report-server-report-into-an-asp-net-web-application/

power bi报表服务器

power bi报表服务器_如何将Power BI Report Server报表嵌入ASP.Net Web应用程序相关推荐

  1. PBI Report Server 报表页面自动刷新 2步走

    参考 PBI Report Server 报表页面自动刷新 - 知乎 (zhihu.com) 1.按F12调出调试工具,修改刷新按钮的id,改为c 2.打开控制台,输入以下代码运行,完工 setInt ...

  2. power bi可视化表_如何使用Power BI可视化数据?

    power bi可视化表 什么是数据可视化? (What is Data Visualization?) With the technological revolution, data went fr ...

  3. bi可视化工具_适用于您的BI解决方案的最佳数据可视化和Web报告工具

    bi可视化工具 通过智能数据分析使复杂变得简单 (Making the complex simple with smart data analysis) It is hard to overestim ...

  4. 使用mvc模式读取服务器上的文件,关于C#:如何使用asp.net MVC应用程序从服务器上的网络路径读取...

    我已经在运行.net MVC应用程序的Web服务器上设置了到另一台用于存储上载文件的服务器的网络路径.为了允许通过应用程序将文件上传到网络路径,我修改了IIS中的应用程序池,以便该应用程序有权上传到它 ...

  5. mvc如何应用nuget包_第五周NuGet软件包-使用Glimpse调试ASP.NET MVC应用程序

    mvc如何应用nuget包 Hey, have you implemented the NuGet Action Plan? Get on it, it'll take only 5 minutes: ...

  6. 永洪报表工具_该怎么选BI工具

    因为有个项目的机会,所以需要学习一下BI工具.该怎么选BI工具呢,用这篇文章做个学习笔记吧. 我将把过程中的得失陆续记录下来,和大家一起进步. 有哪些BI工具呢? 先由 Gartner, Inc.的研 ...

  7. ssh中exit命令退出远程服务器_解决Linux关闭终端(关闭SSH等)后运行的程序或者服务自动停止...

    问题描述:当SSH远程连接到服务器上,然后运行一个服务 ./catalina.sh start,然后把终端开闭(切断SSH连接)之后,发现该服务中断,导致网页无法访问. 解决方法:使用nohup命令让 ...

  8. 苹果mac 连接服务器_每日新闻摘要:苹果从Mac移除Zoom的Web服务器

    苹果mac 连接服务器 Earlier this week, a security researcher disclosed an exploit showing that websites coul ...

  9. SQL Server Report Server 报表用户权限T-SQL查询

    /************************************************************************** 查询用户在报表上的权限 ************ ...

最新文章

  1. 弗洛伊德算法(Floyd)简介
  2. debian中添加sudo命令
  3. golang 警告提示 Error string should not be capitalized or end with punctuation mark
  4. redis有值查询返回null_Redis缓存穿透、缓存并发、热点缓存之最佳招式
  5. js中json的添加和指定位置的删除
  6. php制作图片轮播_图片轮播效果实现方法
  7. 大楼通信综合布线系统_什么是网络综合布线系统组成?网络综合布线系统如何选择线缆?...
  8. 第九周LINUX 学习笔记
  9. 使用Adobe Acrobat提取PDF签章图片
  10. 【sklearn第五讲】特征提取(上)
  11. Jquery中val、text、html的区别
  12. 免校准的电量计量芯片_应物联网而生:合力为HLW8012系列免校准电能计量芯片-测试测量-与非网...
  13. 如何编辑pdf文件内容
  14. GPU Pro 7——实时体积云(翻译,附Unity工程)
  15. c语言c4700错误,C编译错误,运行错误以及常见问题。
  16. 物联网开发笔记(30)- 使用Micropython开发ESP32开发板之控制240x240的oled屏幕显示二维码(ST7789芯片)
  17. Android性能优化之较精确的获取图像显示到屏幕上的时间
  18. 全球范围内12个典型区域提取(total runoff)
  19. 得移动互联网者得天下
  20. 首届“云报·春晚”节目单

热门文章

  1. pygame游戏_Pygame游戏——Pong游戏(三)
  2. springboot整合持久层技术(mysql驱动问题)
  3. Jenkins:项目配置
  4. 菜鸟学习Spring——初识Spring
  5. LeetCode(437)——路径总和 III(JavaScript)
  6. ★LeetCode(182)——查找重复的电子邮箱(MySQL)
  7. node 修改文件自启动
  8. 零基础带你学习MySQL—修改表(六)
  9. 机械制图手册_机械制图基本知识大全!
  10. 银行不放款可以换银行贷款吗?