我的的ReportServer asp.net的網頁表單的工作從asp.net的MVC調用時....asp.net的MVC調用的ReportViewer顯示報表文件夾(不報告)
第一個問題: ,但我有什麼與正在顯示一個報告文件夾內容的麻煩......我在Windows中直接從瀏覽器移植於形式窗戶的ReportServer功能及以下作品也 :
http://www.mydomain.com/Reports/Pages/Folder.aspx?ItemPath=%2fB.+TBS
但是當我嘗試使用這個從asp.net嵌入在asp.net mvc我得到一個錯誤,除非我提供ReportServerUrl我 w如下所示:http://www.mydomain.com/ReportServer 我試過
serverReport1.ReportPath =「/Pages/Folder.aspx?ItemPath=%2fB.+TBS」;
以及在此其他變化,我無法弄清楚如何顯示文件夾...
第二個問題:目前我沒有被提示登錄......我還沒有設置在模擬web.config ....我想讓用戶輸入他們的用戶ID和密碼....我如何強制這種情況發生。
這裏是我當前的Page_Load:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
ReportViewer1.ShowParameterPrompts = true;
ReportViewer1.ShowToolBar = true;
ReportViewer1.ShowRefreshButton = true;
ReportViewer1.ShowCredentialPrompts = true;
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ServerReport serverReport1 = ReportViewer1.ServerReport;
//This works to display a report...
// serverReport1.ReportServerUrl = new Uri("http://www.mydomain.com/ReportServer");
// serverReport1.ReportPath = "/B. TBS/B.2. Departments";
//This works too...same thing ...getting ready to put into web.config...
string url = @"http://www.mydomain.com/ReportServer";
string ReportName = "B. TBS/B.2. Departments";
serverReport1.ReportServerUrl = new System.Uri(url);
serverReport1.ReportPath = string.Format("/{0}", ReportName);
//This works in Windows, but not here...outputs..Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'
// serverReport1.ReportServerUrl = new Uri("http://www.mydomain.com/Reports/Pages/Folder.aspx?ItemPath=%2fB.+TBS");
// serverReport1.ReportServerUrl = new Uri("http://www.mydomain.com/ReportServer");
// serverReport1.ReportPath = "/Pages/Folder.aspx?ItemPath=%2fB.+TBS";
}
}
這是我目前的asp.net的網頁表單:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportViewer.aspx.cs" Inherits="TBS.Etracs.Web.Main.Reports.Reports" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"
Namespace="Microsoft.Reporting.WebForms"
TagPrefix="rsweb" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server" style="width:100%; height:100%;">
<div>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<rsweb:ReportViewer ID ="ReportViewer1"
runat ="server"
Width ="100%"
Height ="100%"
SizeToReportContent ="True" >
</rsweb:ReportViewer>
</form>
</body>
</html>
感謝。