I use ReportExecutionService class to export a SQL reporting services report to a PDF file. It seems not work, and failed at method “LoadReport”. The error message said: Object moved to <ReportServer Login Page>.
I think, it’s an authentication problem. The report server is set to form authentication, and I wrote a custom security DLL, and share the auth cookie with ASP.NET Web application. It works fine with ReportViewer.
I set ReportExecutionService.Credentials = System.Net.CredentialCache.DefaultCredentials. It looks like my network login windows account (MyDomainName\MyUserName), and of course it is failed. I read the ReportExecutionService class members, and can not find way to pass auth cookie, or some kind of forms authentication object into ReportExecutionService class.
Does anyone render report into PDF (HTML) file successfully by ASP.NET code for forms authentication?
I search the sample code over internet. The sample code only uses CredentialCache.DefaultCredentials, and it looks a windows authentication credential. Am I wrong?
Thanks for any suggestion and advice.
ShawTry setting impersonation to true in the web.config file.
No comments:
Post a Comment