I am trying to pass the loged in username from my dot net application to Report Services. This is my code:
string usern = WindowsIdentity.GetCurrent().Name.ToString();
ReportViewer1.ProcessingMode = ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl =
new Uri(@"http://myserver/reportServer/");
ReportViewer1.ServerReport.ReportPath = @"/path/subpath/reportName";
ReportParameter[] rp = new ReportParameter[1];
rp[0] = new ReportParameter("paramTest", usern);
ReportViewer1.ServerReport.SetParameters(rp);
ReportViewer1.ServerReport.Refresh();
When I run it locally, everything works fine, I can see my username on the parameters textbox. Running it on server, I got "NT AUTHORITY\NETWORK SERVICE" instead of my username. Any ideas? Thanks in advance