Skip to Content
0
Former Member
Sep 11, 2008 at 06:27 AM

Crystal Reports webservice vb.net

13 Views

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?

Using CrystalDecisions version 10.2.3600.0 and Visual Studion 2005

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)