I need to create a datasource in code for a parameter.
The issue I have is when I create the parameter, I set the ValueMember and DisplayMember in the designer and then in the code behind I do this:
Private Sub ChangeoverRunTimeChart_NeedDataSource(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.NeedDataSource
ReportParameters("WorkCentres").AvailableValues.DataSource = GetWorkCentresForDDL()
ReportParameters("WorkCentres").AvailableValues.DisplayMember = "WorkCentreCode"
ReportParameters("WorkCentres").AvailableValues.ValueMember = "ID"
End Sub
Which is the needdatasource event for the report.
When I load up the report, it just shows an empty textbox for the WorkCentres parameter. I can not get it to show a combobox.
Could someone tell me what I am doing wrong please?
The issue I have is when I create the parameter, I set the ValueMember and DisplayMember in the designer and then in the code behind I do this:
Private Sub ChangeoverRunTimeChart_NeedDataSource(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.NeedDataSource
ReportParameters("WorkCentres").AvailableValues.DataSource = GetWorkCentresForDDL()
ReportParameters("WorkCentres").AvailableValues.DisplayMember = "WorkCentreCode"
ReportParameters("WorkCentres").AvailableValues.ValueMember = "ID"
End Sub
Which is the needdatasource event for the report.
When I load up the report, it just shows an empty textbox for the WorkCentres parameter. I can not get it to show a combobox.
Could someone tell me what I am doing wrong please?