locked
How to add a winforms textbox value dynamically to a rdlc? RRS feed

  • Question

  • I would like to know if anyone knows how or if it is possible to add a textbox to a windows form and have the value typed into the textbox displayed on a rdlc upon rendering the report (reportviewer.localreport).

    I am trying to allow a user to add header titles and dates to the report without having to add the values to the database and call them through the dataset.

    this is a vb windows application (VS 2005).

    Thank you,

    Allen Simmons

     

    Thursday, November 16, 2006 10:32 PM

Answers

  • Report parameters can do this.  If you create a parameter on the report, you can refer to it in a textbox in the report.  Just because it is a parameter to the report does not mean that it is a parameter to a query used by the report.  Report parameters can be set programatically using ReportViewer.LocalReport.SetParameters().
    Monday, December 4, 2006 9:51 PM

All replies

  • You can use report parameters to do this. See examples on http://www.gotreportviewer.com

     

    Thursday, November 16, 2006 11:49 PM
  • I have tried parameters, parameters become part of the query. I would like to just allow the user to type data into a textbox and on the button event take the text from the winforms textbox and , for lack of better terminology, copy that text to a rdlc textbox.

    Example:

    I have some reports that are run for engineering that must have a header title and a date. I want the user to be able to define the header title and date on a winforms textbox and when the report is rendered show those values on the reportviewer.localreport

    I hope this makes sense?

     

    Friday, November 17, 2006 4:14 PM
  • Report parameters can do this.  If you create a parameter on the report, you can refer to it in a textbox in the report.  Just because it is a parameter to the report does not mean that it is a parameter to a query used by the report.  Report parameters can be set programatically using ReportViewer.LocalReport.SetParameters().
    Monday, December 4, 2006 9:51 PM
  • Could you please post an example?

    Thank you!

    Monday, December 4, 2006 11:17 PM
  • Tuesday, December 5, 2006 12:19 AM