NeedDataSource event not firing when updating the ReportViewer

4 posts, 0 answers
  1. Charles
    Charles avatar
    2 posts
    Member since:
    May 2009

    Posted 08 Jul 2009 Link to this post

    Hello,

    I upgraded to Telerik Reporting Q2 2009 and my reports are encountering an issue. I have a button on the page that sets the parameters for the report and updates the ReportViewer. However, since I upgraded to Q2 the NeedDataSource event is not firing. If I use Q1 it works fine. I have to use Q2 because Q2 has a fix regarding the page count issue.

    ASPX:
    1) the aspx has checkboxes and dropdowns so the user can have different options when running the report.
    2) View Report button that when clicked assigns the report parameters and sets the report to the reportviewer, just like the examples.

    Report NeedDataSource:
    Here I would dynamically get the data and show or hide sub reports based on the parameters that were passed. I would also be able to store the previous datatable/dataset by using a global variable so that I could reuse some data if there were no change, and only generate new data that is needed.

    As with Q2 the NeedDataSource event is only fired the first time the button is pressed. The second time the button is pressed, I only get to :

    Public Sub New()
            InitializeComponent()
    End Sub

    I have also tried : Me.DataSource = Nothing after InitializeComponent() but that didnt help.

    Thanks for any assistance.

  2. Michael Nagy
    Michael Nagy avatar
    18 posts
    Member since:
    May 2008

    Posted 09 Jul 2009 Link to this post

    I have the same issue , NeedDataSource evnet doesn't fired when i click refreh after change my report parameters .

    here is my code snippet

    1         private void Default_NeedDataSource(object sender, EventArgs e) 
    2         { 
    3            this.reportTotalAnnualSalaryPerEmployeeTableAdapter1.Fill( 
    4                   this.totalPayrollPerEmployeeDataSet.ReportTotalAnnualSalaryPerEmployee, 
    5                 reportParameter["Year"as int?, reportParameter["Employee"as Guid?); 
    6              
    7             this.DataSource = this.totalPayrollPerEmployeeDataSet.ReportTotalAnnualSalaryPerEmployee; 
    8         } 
     
    please i need  help..

  3. DevCraft Release
  4. Steve
    Admin
    Steve avatar
    10942 posts
    Member since:
    May 2014

    Posted 13 Jul 2009 Link to this post

    Hi guys,

    We've not been able to reproduce the issue you describe. Find attached a sample project where you can set report parameters from both the built-in report parameters UI and directly from your .aspx page on a button click event handler. Give it a spin and let us know what differs in your case.

    Best wishes,
    Steve
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  5. Charles
    Charles avatar
    2 posts
    Member since:
    May 2009

    Posted 15 Jul 2009 Link to this post

    Thanks Steve, you had given me a fix in the Support ticket I had sent in.

    If anyone else is looking for an answer:

    In the aspx.cs page:

    ReportViewer1.Report = null;
    ReportViewer1.Report = report;

Back to Top