?
Solved

VB.NET Crystal Reports Login/Username on Dataset

Posted on 2004-09-08
20
Medium Priority
?
3,082 Views
Last Modified: 2012-05-05
I made a crystal report using datasets and when i run it it asks for a user name and password with server and database ?????


Im using a dataset what username, password ??
0
Comment
Question by:Vartana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
  • 4
  • +2
20 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 800 total points
ID: 12009641
make sure your tables are named the same as the typed dataset you generated (also that all fields are there) if it is missing a field/table it will prompt for a database connection.
0
 
LVL 37

Assisted Solution

by:gregoryyoung
gregoryyoung earned 800 total points
ID: 12009647
and yes it would be MUCH more usefull if it old you what it was missing ;)
0
 
LVL 8

Assisted Solution

by:gregasm
gregasm earned 800 total points
ID: 12009687
I've seen this dialog before... sometimes it pops up if the crystal reports shared assemblies are of the wrong version. Is it possible that you have two versions of the Crystal Shared assemblies on the same computer?

HINT: Check the GAC.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Vartana
ID: 12009738
gregasm  no i dont think i have versions of them ?
0
 
LVL 1

Author Comment

by:Vartana
ID: 12009775
The CR gets the values from 2 datasets and 3 tables


DataSet1
------------
---MyTable
------ID
------Name

Dataset2
-------------
---MyTable
------Description
------ID


no in CR i linked the ID of dataset2 mytable to the dataset 1 mytable .  
0
 
LVL 8

Assisted Solution

by:gregasm
gregasm earned 800 total points
ID: 12010006
Well in that case, have you tried supplying the login credentials to the database through CR?
0
 
LVL 27

Assisted Solution

by:planocz
planocz earned 200 total points
ID: 12010045
Heres a sample of a CR report connection to a Database

 
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared

    Public myReport As New ReportDocument        'Gobal Report Doc
 
  '**** Server Connection Vars *********
    Public sDBServer As String = "MYSERVER"
    Public sUSERid As String = "MYUSER"
    Public sDBName As String = "MYDATABASE"
    Public sDBPass As String = ""

 Private Sub GetReportConnection(ByVal myReport)
        ' Objects used to set the proper database connection information
        Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
        Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
        Dim sMYPATH as string      '<-----Directory for your reports
        Try
            ' Load the report
            myReport.Load(sMYPATH, CrystalDecisions.[Shared].OpenReportMethod.OpenReportByTempCopy)
            ' Set the connection information for all the tables used in the report
            For Each tbCurrent In myReport.Database.Tables
                tliCurrent = tbCurrent.LogOnInfo
                With tliCurrent.ConnectionInfo
                    .ServerName = sDBServer
                    .UserID = sUSERid
                    .Password = ""
                    .DatabaseName = sDBName
                End With
                tbCurrent.ApplyLogOnInfo(tliCurrent)
            Next tbCurrent
        Catch Exp As LoadSaveReportException
            MsgBox("Incorrect path for loading report.", _
                    MsgBoxStyle.Critical, "Load Report Error")
        Catch Exp As Exception
            MsgBox(Exp.Message & "   in GetReportConnection Procedure", MsgBoxStyle.Critical, "General Error")
        End Try
    End Sub
0
 
LVL 37

Assisted Solution

by:gregoryyoung
gregoryyoung earned 800 total points
ID: 12010057
he is using push mode greg. you don't need to give credentials ... most likely it is a misnamed table or a missing field / relationship.
0
 
LVL 8

Assisted Solution

by:gregasm
gregasm earned 800 total points
ID: 12010829
push model. yeah, the only thing I can think of involves referencing the wrong version of the shared assemblies.

But if its not that, i'm not sure. but interested in knowing the end resolution.

crystal is not known for being easy to work with.
0
 
LVL 1

Author Comment

by:Vartana
ID: 12011123
so any ideas guy ?
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12011167
as i said make sure your tables have the same names .. that is the major cause I get here using push model ...

DataAdapter.Fill(ds, "CorrectTableName");
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12011171
also how are you pushing in 2 datasets ?
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12011176
better question why are you pushing in 2 datasets you can put the table from dataset2 in dataset1 for crystal and avoid this.
0
 
LVL 1

Author Comment

by:Vartana
ID: 12011196
well because i save all of the contents of the dataset2 to xml and i dont need the data in dataset1


0
 
LVL 1

Author Comment

by:Vartana
ID: 12011207
i used the wizard and it let me link tables
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12011215
what is your datasource setting code ?
0
 
LVL 8

Assisted Solution

by:gregasm
gregasm earned 800 total points
ID: 12011407
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 12011415
in this case the first one brings up a good point but off ... you need to set the datasource for your subreports (not the login)
0
 
LVL 1

Author Comment

by:Vartana
ID: 12011544
yeah none of this is clear to me yet. Can someone clarify this for me ?
0
 

Assisted Solution

by:jonkarGuelph
jonkarGuelph earned 200 total points
ID: 12025694
First go to your report, and VERIFY the database.  This will let you know if you made any changes in your dataset(s) after creating your report.
I generally get the Logon message when I had an error filling my Dataset(s).
Normally one of the Datasets is NOTHING.

Put a break point just before you set your datasource in Crystal; IE.
      myREPORT.SetDataSource(myDATASET)

Then make sure you can see the data within your myDS in all tables.

Hope this helps you out.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question