<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error on Report Viewer with Power BI Report Server in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Error-on-Report-Viewer-with-Power-BI-Report-Server/m-p/537699#M8329</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm testing some ways to embed Power BI reports which store on Power BI Report Server and I am developping a web page in asp.net to view a report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successfully connected to my reports I&amp;nbsp;believe but I have a message "Request failed with empty response" when I get report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All is ok when I connect directly on browser on portal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have some ideas about this one ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Find asp class&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Security.Principal;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ReportViewer_PowerBI
{
    public partial class WebForm1 : System.Web.UI.Page
    {

        private String username;
        private String pwd;
        private String report;

        protected void Page_Load(object sender, EventArgs e)
        {
            ReportViewer1.ProcessingMode = ProcessingMode.Remote;
        }


        protected void Button1_Click(object sender, EventArgs e)
        {
            username = this.txtUser.Text;
            pwd = this.txtPassword.Text;
            report = this.txtReport.Text;

            ReportViewer1.Reset();
            ReportViewer1.ServerReport.ReportServerCredentials = new CustomReportCredentials(username, pwd, "XX");
            ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://myReport");
            ReportViewer1.ServerReport.ReportPath = "/" + report;

            //ReportViewer1.ServerReport.Refresh();

        }
    }

    /// 
    /// Summary description for CustomReportCredentials
    /// 
    public class CustomReportCredentials :
    Microsoft.Reporting.WebForms.IReportServerCredentials
    {

        // local variable for network credential.
        private string _UserName;
        private string _PassWord;
        private string _DomainName;
        public CustomReportCredentials(string UserName, string PassWord,
    string DomainName)
        {
            _UserName = UserName;
            _PassWord = PassWord;
            _DomainName = DomainName;
        }
        public WindowsIdentity ImpersonationUser
        {
            get
            {
                return null;  // not use ImpersonationUser
            }
        }
        public ICredentials NetworkCredentials
        {
            get
            {

                // use NetworkCredentials
                return new NetworkCredential(_UserName,
    _PassWord, _DomainName);
            }
        }
        public bool GetFormsCredentials(out Cookie authCookie,
    out string user, out string password, out string authority)
        {

            // not use FormsCredentials unless you have 
            //implements a custom autentication.
        authCookie = null;
            user = password = authority = null;
            return false;
        }
    }
}&lt;/PRE&gt;&lt;P&gt;And also form web&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;body&amp;gt;
    &amp;lt;form id="form1" runat="server"&amp;gt;
        
        &amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt;
        &amp;lt;/asp:ScriptManager&amp;gt;
        &amp;lt;rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Height="297px"&amp;gt;
                &amp;lt;ServerReport /&amp;gt;
        &amp;lt;/rsweb:ReportViewer&amp;gt;
        
        &amp;lt;p&amp;gt;
            User&amp;lt;asp:TextBox ID="txtUser" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p id="txtPwd"&amp;gt;
            Password&amp;lt;asp:TextBox ID="txtPassword" runat="server" style="margin-bottom: 0px"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            Report&amp;lt;asp:TextBox ID="txtReport" runat="server" style="margin-bottom: 4px"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            &amp;lt;asp:Button ID="btnVal" runat="server" OnClick="Button1_Click" Text="Load" /&amp;gt;
        &amp;lt;/p&amp;gt;
        
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 09 Oct 2018 17:02:08 GMT</pubDate>
    <dc:creator>floshdraw</dc:creator>
    <dc:date>2018-10-09T17:02:08Z</dc:date>
    <item>
      <title>Error on Report Viewer with Power BI Report Server</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Error-on-Report-Viewer-with-Power-BI-Report-Server/m-p/537699#M8329</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm testing some ways to embed Power BI reports which store on Power BI Report Server and I am developping a web page in asp.net to view a report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successfully connected to my reports I&amp;nbsp;believe but I have a message "Request failed with empty response" when I get report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All is ok when I connect directly on browser on portal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have some ideas about this one ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Find asp class&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Security.Principal;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ReportViewer_PowerBI
{
    public partial class WebForm1 : System.Web.UI.Page
    {

        private String username;
        private String pwd;
        private String report;

        protected void Page_Load(object sender, EventArgs e)
        {
            ReportViewer1.ProcessingMode = ProcessingMode.Remote;
        }


        protected void Button1_Click(object sender, EventArgs e)
        {
            username = this.txtUser.Text;
            pwd = this.txtPassword.Text;
            report = this.txtReport.Text;

            ReportViewer1.Reset();
            ReportViewer1.ServerReport.ReportServerCredentials = new CustomReportCredentials(username, pwd, "XX");
            ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://myReport");
            ReportViewer1.ServerReport.ReportPath = "/" + report;

            //ReportViewer1.ServerReport.Refresh();

        }
    }

    /// 
    /// Summary description for CustomReportCredentials
    /// 
    public class CustomReportCredentials :
    Microsoft.Reporting.WebForms.IReportServerCredentials
    {

        // local variable for network credential.
        private string _UserName;
        private string _PassWord;
        private string _DomainName;
        public CustomReportCredentials(string UserName, string PassWord,
    string DomainName)
        {
            _UserName = UserName;
            _PassWord = PassWord;
            _DomainName = DomainName;
        }
        public WindowsIdentity ImpersonationUser
        {
            get
            {
                return null;  // not use ImpersonationUser
            }
        }
        public ICredentials NetworkCredentials
        {
            get
            {

                // use NetworkCredentials
                return new NetworkCredential(_UserName,
    _PassWord, _DomainName);
            }
        }
        public bool GetFormsCredentials(out Cookie authCookie,
    out string user, out string password, out string authority)
        {

            // not use FormsCredentials unless you have 
            //implements a custom autentication.
        authCookie = null;
            user = password = authority = null;
            return false;
        }
    }
}&lt;/PRE&gt;&lt;P&gt;And also form web&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;body&amp;gt;
    &amp;lt;form id="form1" runat="server"&amp;gt;
        
        &amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt;
        &amp;lt;/asp:ScriptManager&amp;gt;
        &amp;lt;rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Height="297px"&amp;gt;
                &amp;lt;ServerReport /&amp;gt;
        &amp;lt;/rsweb:ReportViewer&amp;gt;
        
        &amp;lt;p&amp;gt;
            User&amp;lt;asp:TextBox ID="txtUser" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p id="txtPwd"&amp;gt;
            Password&amp;lt;asp:TextBox ID="txtPassword" runat="server" style="margin-bottom: 0px"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            Report&amp;lt;asp:TextBox ID="txtReport" runat="server" style="margin-bottom: 4px"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            &amp;lt;asp:Button ID="btnVal" runat="server" OnClick="Button1_Click" Text="Load" /&amp;gt;
        &amp;lt;/p&amp;gt;
        
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;&lt;/PRE&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 17:02:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Error-on-Report-Viewer-with-Power-BI-Report-Server/m-p/537699#M8329</guid>
      <dc:creator>floshdraw</dc:creator>
      <dc:date>2018-10-09T17:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error on Report Viewer with Power BI Report Server</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Error-on-Report-Viewer-with-Power-BI-Report-Server/m-p/1442548#M16354</link>
      <description>&lt;P&gt;You got any solution for this issue, I am also facing same issue..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 15:14:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Error-on-Report-Viewer-with-Power-BI-Report-Server/m-p/1442548#M16354</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-19T15:14:39Z</dc:date>
    </item>
  </channel>
</rss>

