on 09-13-2008 6:55 AM
I have a crystal report which is running succesfull in windows application. I used the same report to deploy from webservice Print automatically from webserver to a specific printer
In web.config file I am using u201C<identity impersonate="true" userName="DOMAIN\USERNAME" password="PASSWORD"/>u201D
When I call the method PrintToPrinter, getting a error as
u201CError in File C:\DOCUME1\VINOTH\ASPNET\LOCALS1\Temp\Copy of MISys Purchase Query {6E996346-B73A-4A42-8F3C-2818B5C97C88}.rpt: Unable to connect: incorrect log on parameters.u201D
Supplier - UserName, Password, ServerName, DBName are correct, using the same logon info in windows application which wors fine. Can any one help me?
Connection status successes - Connecting database directly using Connection Provider
_Using CrystalDecisions version 10.2.3600.0, Visual Studion 2005 and IBM DB2 _
Dim report As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
report.Load(ReportPath)
report.SetDatabaseLogon(UserName, Password, ServerName, DBName)
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
For Each myTable In report.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.ServerName = ServerName
myLogin.ConnectionInfo.DatabaseName = DBName
myLogin.ConnectionInfo.Password = Password
myLogin.ConnectionInfo.UserID = UserName
myLogin.ConnectionInfo.IntegratedSecurity = True
myTable.ApplyLogOnInfo(myLogin)
myTable.TestConnectivity()
Next
report.PrintOptions.PrinterName = PrinterName
report.PrintToPrinter(1, False, 0, 0)
Edited by: vinoth kumar on Sep 11, 2008 9:02 AM
You should either be setting the user and password in code, or use Integrated Security, not both.
So you should have either:
myLogin.ConnectionInfo.Password = Password
myLogin.ConnectionInfo.UserID = UserName
OR:
myLogin.ConnectionInfo.IntegratedSecurity = True
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.