Advertisement

04.21.2008 at 08:31AM PDT, ID: 23339912
[x]
Attachment Details

crystal report vb

Asked by sevensnake77 in .Net Editors & IDEs, Microsoft Applications, Microsoft Development

Tags: crystal report vb

yes i have a crystal report it loads up with no problem using integrated security.

The problem is ((( MyCommand.CommandText = "Select * From SalesTPR where UserID = rice'")))
my select statement is I tryied an where UserID = @UserID but that does not seem to work to load my crystal report.
so i have to specify a name like rice because that is the user logged in. How can I use rice so any user that logs in it will
read @UserIDStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
Dim rpt As New CrystalReport1   ' report created
        Dim myConnection As SqlConnection
        Dim MyCommand As New SqlCommand
        Dim myDA As New SqlDataAdapter
        Dim myDS As New Dataset3 ' Dataset created
 
        Try
            myConnection = New SqlConnection(Application("A1SConnString"))
            'Dim cmd As New SqlCommand("GetSalesTPR", myConnection)
            ' cmd.CommandType = CommandType.StoredProcedure
            MyCommand.Connection = myConnection
            MyCommand.CommandText = "Select * From SalesTPR where UserID = 'aprice'"
            MyCommand.CommandType = CommandType.Text
            myDA.SelectCommand = MyCommand
            'Dim prm As New SqlParameter("@UserID", SqlDbType.VarChar, 50)
            'cmd.CommandType = CommandType.StoredProcedure
            'prm.Value = ReadCookie(Tokens.UserId)
            'cmd.Parameters.Add(prm)
            myDA.Fill(myDS, "SalesTPR")
            rpt.SetDataSource(myDS)
            CrystalReportViewer1.ReportSource = rpt
[+][-]04.21.2008 at 10:21AM PDT, ID: 21403991

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 10:38AM PDT, ID: 21404151

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 10:44AM PDT, ID: 21404213

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 10:51AM PDT, ID: 21404296

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 11:39AM PDT, ID: 21404689

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Microsoft Applications, Microsoft Development
Tags: crystal report vb
Sign Up Now!
Solution Provided By: apeter
Participating Experts: 1
Solution Grade: B
 
 
[+][-]04.21.2008 at 11:53AM PDT, ID: 21404806

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 12:05PM PDT, ID: 21404916

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 12:18PM PDT, ID: 21405029

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906