By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

crystal report viewer error: invalid report source

P: n/a
Hi All,
I am working on Vb.net application with oracle as my database. I have
developed reports using crystal report 9. Usually when you open reports
directly in crystal report viewer control it prompts you for any
necessary login information. My goal was to provide the login
information by means of code, so that the user is not prompted for any
login information. I tried to write the following code to achieve that
purpose. On running the code I get the error Invalid report source. I
know the same code works if I create a report with SQL server as my
database. Can you point what might be possibly wrong in my code.

Code:
-----------------------------------------------------------

Dim CrReportDocument As ReportDocument
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo

CrReportDocument = New ReportDocument()
CrReportDocument.Load("C:\Report4.rpt")

crConnectionInfo = New ConnectionInfo()

With crConnectionInfo
.DatabaseName = ""
.Password = "xyz"
.ServerName = "xyz"
.UserID = "xyz"
End With

crDatabase = CrReportDocument.Database
crTables = crDatabase.Tables

For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next

' crv is crystal report viewer control
crv.ReportSource = CrReportDocument

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Perhaps setting a database would be useful...

Also, when doing something like this, make sure your using Mixed Mode
authentication. If you are using strait integrated windows auth, this can't
work.

-CJ
"Harshil" <me@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi All,
I am working on Vb.net application with oracle as my database. I have
developed reports using crystal report 9. Usually when you open reports
directly in crystal report viewer control it prompts you for any
necessary login information. My goal was to provide the login
information by means of code, so that the user is not prompted for any
login information. I tried to write the following code to achieve that
purpose. On running the code I get the error Invalid report source. I
know the same code works if I create a report with SQL server as my
database. Can you point what might be possibly wrong in my code.

Code:
-----------------------------------------------------------

Dim CrReportDocument As ReportDocument
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo

CrReportDocument = New ReportDocument()
CrReportDocument.Load("C:\Report4.rpt")

crConnectionInfo = New ConnectionInfo()

With crConnectionInfo
.DatabaseName = ""
.Password = "xyz"
.ServerName = "xyz"
.UserID = "xyz"
End With

crDatabase = CrReportDocument.Database
crTables = crDatabase.Tables

For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next

' crv is crystal report viewer control
crv.ReportSource = CrReportDocument

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.