Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-04-19
4
Medium Priority
?
338 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,
0
Comment
Question by:rtay
  • 2
  • 2
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35427092
0
 
LVL 5

Author Comment

by:rtay
ID: 35435400
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.  
0
 
LVL 5

Author Comment

by:rtay
ID: 35435518

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

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 35438941
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Six Sigma Control Plans
Starting up a Project

810 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