2 posts, 0 answers
  1. Anshul
    Anshul avatar
    1 posts
    Member since:
    May 2013

    Posted 20 May 2013 Link to this post

    I am new to Telerik software so i need your help.I want to bind datatable to reportviewer on button click (button on aspx page). The data in the ReportViewer
    should be updated based on textbox value on my aspx page.

    1)I am using a stored procedure which takes two arguments of DateTime type and returns a datatable. I want to Bind this Datatable to ReportViewer.
    2) I want to rebind DataSource on my report based on parameters passed from aspx file (2 parameters of datetime type).

    Help Please

  2. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 22 May 2013 Link to this post

    Hi Anshul,

    The best way to handle this scenario would be to create some business logic. Crate a method that takes two DateTime  parameters, calling your Stored Procedure, and returns a DataTable or DataSet. This is the best-practice approach since it allows you to create separate layers in you project that can be maintained independently without breaking other functionality.

    Once you crate the business logic, you can add a ObjectDataSource to your Report that will call that method with the two DateTime parameters.

    Now, you have a choice to make. You can have the user enter the parameters on your ASPX page, but then you need to first pass the parameters into the Report - so the report can utilize them when making a call to your data access layer.

    A simpler approach is to add two Report Parameters into the report itself, so the user enters the data directly into the Report using the ReportViewer.
  3. DevCraft R3 2016 release webinar banner
Back to Top