Click here to Skip to main content
15,899,937 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here's the code which i am using for crystal report generation through front end
all is going well but after clicking on refresh even after passing correct username and password it shows login failed

Dim cryRpt As New ReportDocument
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table

cryRpt.Load("C:\Documents and Settings\Administrator\Desktop\Sales_Analysis 020313.rpt")

With crConnectionInfo
.ServerName = "TESTVM"
.DatabaseName = "SGUJDT"
.UserID = "sa"
.Password = "admin-123"
End With

CrTables = cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next

CrystalReportViewer1.ReportSource = cryRpt
Posted

 
Share this answer
 
Hi
If in your project there are two dataset then it show the login form when you have to see the crystal report.
you can use the one dataset then it dose not ask the login.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900