on 05-02-2016 5:36 AM
I've created a simple report application that view our monthly payment. But when I click the button view. It prompts the Database Login.
Server name: HAS VALUE
Database: NO VALUE
Login ID: HAS VALUE
Password: HAS VALUE
The problem is, the Database field is blank. But I've checked the SQL Database. The database is existing.
Me.Text = "" & oCompany.CompanyName & " - Payment Schedule Report"
Dim iCon As New System.Drawing.Icon(xPath & "\AppIcon1.ico")
Me.Icon = iCon
Me.WindowState = FormWindowState.Maximized
ComboBox1.Text = "Choose Export Format"
Dim oConnectInfo As New ConnectionInfo
Dim oCRTableInfos As New TableLogOnInfos
Dim oCRTableInfo As New TableLogOnInfo
Dim oTables As Tables
Dim oTable As Table
cryRpt = New ReportDocument
cryRpt.Load(xPath & "\Rpt\App_BuyerLedger.rpt")
With oConnectInfo
'MsgBox(oCompany.CompanyDB)
.ServerName = "" & oCompany.Server & ""
.DatabaseName = oCompany.CompanyDB
.UserID = "" & oCompany.DbUserName & ""
.Password = "p@ssw0rd"
.Type = ConnectionInfoType.SQL
End With
oTables = cryRpt.Database.Tables
For Each oTable In oTables
'oCRTableInfo = oTable.LogOnInfo
oCRTableInfo.ConnectionInfo = oConnectInfo
oTable.ApplyLogOnInfo(oCRTableInfo)
Next
oCRTableInfos.Add(oCRTableInfo)
oParameter()
CrystalReportViewer1.EnableRefresh = True
CrystalReportViewer1.LogOnInfo = oCRTableInfos
CrystalReportViewer1.ReportSource = cryRpt
'CrystalReportViewer1.Refresh()
Hi Bryan,
Please search first... see this thread -
Don't Add the table, it already exists.
' oCRTableInfos.Add(oCRTableInfo)
And if it's a Store Procedure set the parameter values first.
Only reason it would prompt and values blank is the app can't find the Client, or you are adding a table that doesn't need to be.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And as I said, the reason for those fields being blank or not editable is because the client PC does not have the DB client installed or it is not available to your app.
Check it. If you use a report with saved data and hit the refresh button it should prompt for log on on info, again, if it's is un-editible or missing info it's because the app cannot find the client
Add debugging code to your app so you can see if the info is being set correctly.
Don
It still needs a client installed.
From the screen shot of my test app it is using OLE DB to connect. Try using the IP address of your PC rather than the name. Could be your DNS look up is not up to date.
I assume after changing that connection info you did click on the Set Logon button correct?
Don
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.