We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Open a Report and Pass a parameter to an embeded Windows Report from a Form in Visual Studio 2008

Medium Priority
348 Views
Last Modified: 2012-08-13
I have a filtered form displaying information on a specific id field (truckno) on a form.  I need a button to open a report that will show only information relating to that truckno ID.  I need to know how to open the embedded windows report and pass the paramater to the report so that it will open to the correct informaiton without prompting for information.

Thank you,
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
rtayIT Director

Author

Commented:
This is not really what I am looking for.  I get the text box prompt to show up, but I need to pass a value to that textbox in the report from a text box in the application form using a button control.  for example, the button click will call the report form to open and pass the required parameter to the report textbox, so the report will open to the desired content.  
rtayIT Director

Author

Commented:

I think the following code may work, but I am using a remote server for SSRS and not a local one.  How would I change the code for that.  And is the code below correct.

Public Class Form2

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'Develop_TareWeightDataSet.tbl_TruckInfo' table. You can move, or remove it, as needed.
        Me.tbl_TruckInfoTableAdapter.Fill(Me.Develop_TareWeightDataSet.tbl_TruckInfo)

        Dim p(0) As ReportParameter
        p(0) = New ReportParameter("mTruckNo", mTruckNo)
        ReportViewer1.LocalReport.SetParameters(p)
        Me.ReportViewer1.RefreshReport()
        ReportViewer1.ZoomPercent = 75
    End Sub
End Class

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.