473,387 Members | 3,750 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,387 software developers and data experts.

Crystal Report Viewer

Hello,

I'm new to Crystal Reports and I am having a problem with a login box
showing up when I try to view a report in the report viewer. I have found
the following code, listed below, to bypass the login prompt however I am
not sure how to apply this to the report.

Thnak you

Private Shared Function SetUserAndPassword(ByRef rp As
CrystalDecisions.CrystalReports.Engine.ReportDocum ent, _
ByVal ServerName As String, ByVal UserId As String, _
ByVal Password As String, ByVal DatabaseName As String) As
Boolean

Dim li As CrystalDecisions.Shared.TableLogOnInfo, i As Integer
Dim ci As CrystalDecisions.Shared.ConnectionInfo
Dim ReturnCode As Boolean = True

Try
With rp
For i = 0 To .Database.Tables.Count - 1
li = .Database.Tables(i).LogOnInfo
ci = li.ConnectionInfo

ci.ServerName = ServerName
ci.Password = Password
ci.UserID = UserId
ci.DatabaseName = DatabaseName

.Database.Tables(i).ApplyLogOnInfo(li)
Next i
End With

Catch erreur As Exception
' DO something with the error
ReturnCode = False

End Try

Return ReturnCode
End Function
--------------------------------------------------------
Jul 21 '05 #1
0 1246

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Schuldenfrei | last post by:
Dear NG, I have Crystal Reports working to a file and directly to the printer with the following: private void mnuInvRep1301_Click(object sender, System.EventArgs e) {
5
by: Robert Schuldenfrei | last post by:
Hi Again, Forgive me for posting this again, but old items seem to get little review. I thought I could adjust the viewer properties without any further aid from the NG, but I was wrong. When...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
17
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far says it's a .net problem. Here's the problem, we're...
0
by: Chris | last post by:
I have the following situation in a VB.Net App I am working on: 1.)A report created in VS.Net 2003 using the CR.Net component of VS 2003. 2.)The datasource for the report is a Stored Proc in a...
0
by: mano.bharath | last post by:
I am developing a windows application in VB.NET 2005 that includes a number of crystal reports. To use the reports I use the included crystal report viewer and pass a dataset to the report at...
0
by: mano.bharath | last post by:
I am developing a windows application in VB.NET 2005 that includes a number of crystal reports. To use the reports I use the included crystal report viewer and pass a dataset to the report at...
1
by: pmkconsulting | last post by:
Hello, I am using an asp script that uses rptserver.asp to display some reports over http. It worked fine previously but now the webpages with the report display just hang. I tried switching from...
0
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the...
7
by: Jlo | last post by:
Hi, I have a c# winforms application. When I call the report file, it shows me all the records in the table. How can I make it to call only a particular range. i have the following code...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.