我正在使用vs2013& SSRS报告2008R2高级快递版。 我有共同的reportreer webform,即
<form id="CommonReport" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<rsweb:ReportViewer ID="RV" runat="server" Font-Names="Verdana" Font-Size="8pt" Height="464px" ProcessingMode="Remote" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="661px">
</rsweb:ReportViewer>
<div>
</div>
</form>
我想传递报告名称,参数&amp;来自其他webform的sql凭证(即sql server Name,username&amp; Password)。
请帮忙,我一周以来都在努力。 我做了以下代码,但它问我用户名和&amp;密码,manulay我打字但我需要通过programitcaly
private void showReport()
{
string SSRS = ConfigurationManager.AppSettings["SSRS"];
ReportViewer1.Reset();
ReportViewer1.ProcessingMode = ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new Uri(SSRS); ;// new Uri(urlReportServer); //Set the ReportServer Url
ReportViewer1.ServerReport.ReportPath = "/sampleReport";
ReportViewer1.ShowCredentialPrompts = true;
ReportParameter reptParam = new ReportParameter("proposalId", proposalId.Text);
ReportViewer1.ServerReport.SetParameters(reptParam);
ReportViewer1.ServerReport.Refresh();
}
答案 0 :(得分:1)
点击here查看DataSourceCredentialsType
您可以通过
reportViewer1.ServerReport.SetDataSourceCredentials(new[] { new DataSourceCredentials() { Name = "XXX", Password = "XXXXXX" } });