Crystal Report based on ADO.Net dataset prompts for database login 
Author Message
 Crystal Report based on ADO.Net dataset prompts for database login


I can't figure this out.  I have a strongly typed, simple Crystal Report
based on a strongly typed ADO.NET dataset/datatable.
The dataset is populated and is located on another form (if this matters).
Everytime I attempt to preview the report, I am prompted for Database Login
Information...Server Name, Database Name, User ID, Password, etc.

The dataset is there, no doubt about this, and I tried setting its visbility
to Public (shouldn't have to, but...).

Any suggestions?


Sun, 27 Nov 2005 13:20:56 GMT  
 Crystal Report based on ADO.Net dataset prompts for database login
Hello Mark
You need to do apply the login information for each table
of the report before viewing it. This example assume that
your report name is CrystalReport1 ...
Jorge Cavalheiro

        Dim crReportDocument As New CrystalReport1()
        Dim crDatabase As Database
        Dim crTables As Tables
        Dim crTable As Table
        Dim crTableLogOnInfo As TableLogOnInfo
        Dim crConnectionInfo As ConnectionInfo

        'Create an instance of the strongly-typed report
        crReportDocument = New CrystalReport1()

        'Setup the connection information structure to be
        'to log onto the datasource for the report.
        crConnectionInfo = New ConnectionInfo()
        With crConnectionInfo
            .ServerName= "server"            
            .DatabaseName = "database"
            .UserID = "User name"
            .Password = "pass"
        End With

        'Get the table information from the report
        crDatabase = crReportDocument.Database
        crTables = crDatabase.Tables

        'Loop through all tables in the report and apply
the connection
        'information for each table.
        For Each crTable In crTables
            crTableLogOnInfo = crTable.LogOnInfo
            crTableLogOnInfo.ConnectionInfo =

        'Set the viewer to the report object to be

        CrystalReportViewer1.ReportSource =

Sun, 27 Nov 2005 16:44:37 GMT  
 [ 2 post ] 

 Relevant Pages 

1. programmatically adding ADO dataset to crystal report in .NET

2. Passing a variable from VB.NET to a Crystal report parameter or formula with no prompt

3. Crystal Reports and ASP.NET/Prompting the User for Parameters

4. Passing Dataset to Crystal Report in VB.Net

5. Using DataSet In the Crystal report.NET

6. Crystal Reports 8.5 (VB6) to Crystal Reports NET (VB.NET) conversion

7. Sorting in crystal reports dataset

8. Missing some steps in creating a report to use a dataset

9. Report with untyped DataSet (ADO.NET)

10. Help in Reporting off ADO.NET DataSet

11. Crystal Reports and VB.Net Login Error

12. - Crystal Reports Login failure.


Powered by phpBB® Forum Software