Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 HOW TO PROVIDE USRNAME & PWD IN REPORTVIEWER PROG

Author  Topic 

imranabdulaziz
Yak Posting Veteran

83 Posts

Posted - 2008-01-30 : 23:15:40
dear all,
i am using asp.net 2.0 , C# and sql server 2005.
i built one server side report and deployed it to reportserver it working fine(but when i access the report i need to supply user name and password to access database ). now i am calling the same report on button click event and providing the username and password from programme only i am getting error like
The request failed with HTTP status 401: Unauthorized.

but with same username and password i open my report in reportserver . later i searched in google and made my reportserver directory aunonymius . but it showing same error

please help

the code i written to fetch the report is

protected void btnReport_Click(object sender, EventArgs e)
{
ReportViewer1.ShowCredentialPrompts = false ;
ReportViewer1.ServerReport.ReportServerCredentials = new ReportCredentials("SA", "LITTLEANGEL" , "BINDH2");
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new System.Uri("http://servername/reportserver");
ReportViewer1.ServerReport.ReportPath = "/imran/RPT/REPORT2";
ReportViewer1.ServerReport.Refresh();
}
   

- Advertisement -