Showing posts with label programmatically. Show all posts
Showing posts with label programmatically. Show all posts

Tuesday, March 27, 2012

Exporting From SQL Server To MSACCESS

Hi,

I Need to make a script or task that programmatically export data from SQL Server to Access File , and how to call the script from the .NET?

Create SSIS package using Import/Export Wizard, you can then run this package from any .NET application either by running DTEXEC or using SSIS object model - see SQL Books Online for sample syntax of both.

Wednesday, February 15, 2012

Export report to PDF programmatically (forms authentication)

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.