473,290 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,290 software developers and data experts.

crystal report viewer error: invalid report source

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
1 13927
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: mrwoopey | last post by:
I have a asp.net application that uses the crystal report viewer control. It displays all of my reports but all of a sudden it started giving me the following error on ONLY two reports: "Fail...
2
by: jkbliss | last post by:
I am getting "Error Creating Control" when I insert a CrystalReportViewer onto a VB .NET web page form. I have just installed this VS .NET upgrade from VS v6 and this is the first time I have tried...
1
by: JC | last post by:
In my Crystal Report Viewer control properties, the reportsource field is not enabled and will not allow me to insert a reportsource. I have also tried to code in the reportsource but get an error....
3
by: Brian Henry | last post by:
Is there any way to get the status of a report being generated by the crystal reports viewer control? I have a report that takes up to 10 minutes to run and it looks like it's just jamed while this...
2
by: Frank Teunen | last post by:
Dear reader, I created a very simple vb.net windows application with just one control: a crystal report viewer. If I deploy this application to another computer, I receive following error...
1
by: Dentharg | last post by:
Hi! How can I rename this tab in Crystal Report Viewer from "Main Report" to something else? Thanks!
0
by: glbdev | last post by:
Hi. I am trying to add a Crystal Reports view to my page and get this error: Compiler Error Message: CS1595: 'CrystalDecisions.Web.CrystalReportViewer' is defined in multiple places; using...
2
by: Peter Afonin | last post by:
Hello, I'm new to Crystal reports. Recently I developed my first report, using class as a datasource, and it works OK. But when I created a second report, I started getting error: "Invalid...
1
by: Sep410 | last post by:
Hi all, I am new in vb.net and I have problem with crystal report viewer componenet. I was working on my application in office and everything was fine. I brought the application home and I tried to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.