Databinding Issue

3 posts, 1 answers
  1. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 08 Oct 2009 Link to this post

    Hi
     
    I have a report with the databinding at runtime.
     
    This code displays a blank report even on hitting the report refresh icon.
     
    Public Sub New()
    InitializeComponent()
    Dim fs As New CPSMDAL.JobPlan
    Dim fsDT As DataTable = fs.JobPlanReport(JobPlan_ID)
    Me.DataSource = fsDT
    End Sub
     
    However this still displays a blank report, but on hitting the refresh icon it does display the full report.

     

    Public Sub New()
    InitializeComponent()
    End Sub

     

     


    Private
    Sub JobPlan_Frontsheet_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
    Dim fs As New CPSMDAL.JobPlan
    Dim fsDT As DataTable = fs.JobPlanReport(JobPlan_ID)
    Me.DataSource = fsDT
    End Sub

     

    If I debug the code, the recordset has 15 members, why isn't it binding.
  2. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 08 Oct 2009 Link to this post

    Hi Andy,

    As noted in the Adding a Data Source through NeedDataSource report event help article, you should use the processing report object when in the context of an event:

    Private Sub JobPlan_Frontsheet_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
    Dim fs As New CPSMDAL.JobPlan
    Dim fsDT As DataTable = fs.JobPlanReport(JobPlan_ID)
    (TryCast(sender, Telerik.Reporting.Processing.Report)).DataSource = fsDT
    End Sub


    Greetings,
    Steve
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 09 Oct 2009 Link to this post

    Thnaks.

    Sorry I missed that.

    Andy
Back to Top