PC Review


Reply
Thread Tools Rate Thread

crystal report viewer error: invalid report source

 
 
Harshil Patel
Guest
Posts: n/a
 
      4th Nov 2003

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!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Crystal Report to Network Print Mailbox While Bypassing Crystal Report Viewer. John Smith Microsoft VB .NET 0 17th Jan 2007 04:17 PM
Change Crystal Report Zoom Level using percentages in Crystal Report Viewer (Dotnet) Alex Stevens Microsoft Dot NET 1 30th Jun 2004 12:34 PM
crystal report viewer cant assign report source =?Utf-8?B?SkM=?= Microsoft VB .NET 1 12th May 2004 06:18 AM
Error while calling Crystal Reports -- "Invalid Report Source" Bibin Microsoft ADO .NET 2 13th Sep 2003 07:09 AM
Error while calling Crystal Reports -- "Invalid Report Source" Bibin Microsoft ADO .NET 0 11th Sep 2003 07:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:40 AM.