Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

report.rdlc parameter

Posted on 2007-08-09
2
Medium Priority
?
1,834 Views
Last Modified: 2013-11-26
i designed report (report.rdlc) with parameter (PARAM1)
then from the form there is text box (txt.text="my name")
I want pass txt.text = "my name" to PARAM1
0
Comment
Question by:matalahmari
2 Comments
 
LVL 10

Accepted Solution

by:
kdwood earned 2000 total points
ID: 19669275
Matal,

Here is what you need to do:

On the form load event of the form that you have embedded the ReportViewControl into, you add a parameter or parameters like this:

' Define a list of parameters to send to the report.   Note, there could be more than one parm in the list.

     Dim paramList As New Generic.List(Of ReportParameter)

     paramList.Add(New ReportParameter("myParmName", "myParmVal", True))

' Now assign the parameter list to the actual report via the SetParmameters method

     ReportViewer1.LocalReport.SetParameters(paramList)

' Refresh as display the report

    Me.ReportViewer1.RefreshReport()
    Me.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)


Now on the RDLC report itself you do the following:

1. Click on Report, then Report Parameters.  
2. Click add Parameter and give it a name in the name field.
3. Click Ok to close the dialog.
4. Right-Click On the textbox field on the report that you want to assign the parameter to and choose expression.
5. Click Parameter and then select the one that you just created above.  You will not see and expression that looks like =Parameters!YourParmName.

Click OK and run the report.

Regards,

Keith
0
 

Author Comment

by:matalahmari
ID: 19671306
DEAR kdwood:

I HAVE ERROR IN "ReportViewer1.LocalReport.SetParameters(paramList)"

EVERY THING IS OK BUT I DON'T KNOW WHY ERROR MESSAGE IS APPEARS SO PLEASE IF ANY ONE HAVE SAMPLE APPLICATION WITH VB.NET SEND IT TO ME
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

580 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