473,498 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 13946
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
8731
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
3539
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
1810
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
2431
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
3962
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
3303
by: Dentharg | last post by:
Hi! How can I rename this tab in Crystal Report Viewer from "Main Report" to something else? Thanks!
0
1061
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
5136
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
899
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...
0
7004
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5464
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.