0

I am working on a Windows Application,Having trouble crating a RDLC Local report.

There are just 2 text boxes in the report, One is Employee Name & another one is address.

Everything is alright but I couldn't figure out how to pass RDLC Report variable & show its value in the Report text boxes or in the report .

Thanks

2 Answers 2

1

Check this post:

Using the WinForms ReportViewer Control

EDIT:

Suppose you have a TextBox Control "TxtParameter" where you enter the employee Social Security Number.

    'Create a report parameter for the sales order number 
    Dim rpEmployeeSSN As New ReportParameter()
    rpEmployeeSSN.Name = "SocialSecurityNumber"
    rpEmployeeSSN.Values.Add(TxtParameter.Text)

    'Set the report parameters for the report
    Dim parameters() As ReportParameter = {rpEmployeeSSN}
    localReport.SetParameters(parameters)

    'Refresh the report
    reportViewer1.RefreshReport()
1
  • Hey @Nathan thanks for reply, I have everything setup & also I can see Blank reportViewer when I run the application but could't pass the parameter to the rdlc. Thanks
    – Pankaj
    Mar 21, 2012 at 5:02
-2
    *****Me.movingselectedTableAdapter.Fill(Me.LRCDBDataSet.movingselected)
    '+++++++++++++ passing parameter
    Dim repdate As Date = System.DateTime.Now.ToShortDateString()
    Dim params(0), myparam As ReportParameter
     '++++++++++++++++++try2
    Dim myparams As New List(Of ReportParameter)
    myparam = New ReportParameter("rptcrdate", repdate)
    myparams.Add(myparam)
    'Report_Parameter_1
    ReportViewer1.LocalReport.SetParameters(myparams)
    Me.ReportViewer1.RefreshReport()*****
1
  • 3
    Consider adding more information in the answer. What does above piece of code do?
    – ch4nd4n
    Dec 6, 2012 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.