Sorry, my bad - I forgot that was Read Only
You've got to set
rptInventory.ServerReport.ReportServerCredentials
Have a look at this link, which explains in full how to do this (scroll down to the answer by H.Laasri)
http://int.social.msdn.microsoft.com/Forums/en/vsreportcontrols/thread/5aa7eee7-d4a7-427a-ab8d-7a3d4d4f0bf3[
^]
public partial class ReportViewerCredentials : IReportServerCredentials
{
private string _userName;
private string _password;
private string _domain;
public ReportViewerCredentials(string userName, string password, string domain)
{
_userName = userName;
_password = password;
_domain = domain;
}
public WindowsIdentity ImpersonationUser
{
get
{
return WindowsIdentity.GetCurrent();
}
}
public ICredentials NetworkCredentials
{
get
{
return new NetworkCredential(_userName, _password, _domain);
}
}
public bool GetFormsCredentials(out Cookie authCookie,
out string userName, out string password,
out string authority)
{
authCookie = null;
userName = _userName;
password = _password;
authority = _domain;
return false;
}
}
protected void Page_Load(object sender, EventArgs e)
{
ShowReport();
}
private void ShowReport()
{
try
{
ReportViewerCredentials rpCredentials = new ReportViewerCredentials(ConfigurationManager.AppSettings["ReportUser"], ConfigurationManager.AppSettings["ReportPassword"], ConfigurationManager.AppSettings["ReportDomain"]);
ReportViewer1.ServerReport.ReportServerCredentials = rpCredentials;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}