How do you get parameters from another page to work with crystal reports in ASP.NET/VB 2008?

VBBRett
VBBRett used Ask the Experts™
on
I am looking for a way to get a report setup page to work as a paramatized value sender to my crystal Reports web service page in asp.net.  How can I achieve such a thing programmatically?  Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Seven priceFull Stack

Commented:
Do you mean a crystal report page but you want to see the report on the client side.

Author

Commented:
Yes sir!  I already set the crystal reports page as a web page/web service so it can be seen.  my only issue is how to implement parameters from another asp.net page being inserted into this page.

Author

Commented:
When I said "THIS PAGE"  I was referring to the Crystal Reports page.
Full Stack
Commented:
Private Sub GenerateReport()
        Dim rpt As New houseReport  
        Dim myConnection As SqlClient.SqlConnection = New SqlClient.SqlConnection(HttpContext.Current.Application.Get("ConnString"))
        Dim prm As New SqlParameter

        Dim MyCommand As New SqlCommand("Review", myConnection)
        MyCommand.CommandText = "Review" 'Stored Procedure
        MyCommand.CommandType = CommandType.StoredProcedure
        Dim myDA As New SqlDataAdapter
        Dim myDS As New WarehouseData ' Dataset created extension xsd

        ' Dim MyCommand As New SqlParameter

        Try

            prm = New SqlParameter("@StartDate", SqlDbType.SmallDateTime)
            MyCommand.CommandType = CommandType.StoredProcedure
            prm.Value = Request.QueryString("OrderDate")
            MyCommand.Parameters.Add(prm)

           


            prm = New SqlParameter("@UserId", SqlDbType.VarChar)
            MyCommand.CommandType = CommandType.StoredProcedure
            prm.Value = UserId
            MyCommand.Parameters.Add(prm)

            'MyCommand.Connection = myConnection
            'MyCommand.CommandText = "Review" 'Stored Procedure
            'MyCommand.CommandType = CommandType.StoredProcedure
            'MyCommand.Parameters.Add(New SqlParameter("@StartDate", SqlDbType.DateTime)).Value = Request.QueryString("OrderDate")
         
            ''MyCommand.Parameters.Add(New SqlParameter("@UserId", SqlDbType.DateTime)).Value = Request.QueryString("UserId")
            myDA.SelectCommand = MyCommand
            myDA.Fill(myDS, "Review")
            rpt.SetDataSource(myDS)
            myConnection.Open()
            CrystalReportViewer1.ReportSource = rpt ' Connects to viewer using rpt Name of viewer aspx side.

        Catch Excep As Exception
       
            End With

        End Try
    End Sub
Seven priceFull Stack

Commented:
Use the Request query string method. This works fine for me.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial