EDN Admin
Well-known member
I have the following code.
Private Sub genWorkOrderCompForOneCustomer()
If customerNameComboBox.Text = "Please Select a Customer" Then
MessageBox.Show("Please select a customer to create a report for.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
Dim cryRpt As New WorkOrderCompleted_ForOneCustomer
cryRpt.Load()
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
crParameterDiscreteValue.Value = customerNameComboBox.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("CustomerName")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CustomerReportCRV.ReportSource = cryRpt
End Sub
When I run the the application I am not getting the current information from the sql database until I hit the refresh button and enter the parameter. I would like the information to be up to date when first loading the application.
If someone can help me that would be great.
View the full article
Private Sub genWorkOrderCompForOneCustomer()
If customerNameComboBox.Text = "Please Select a Customer" Then
MessageBox.Show("Please select a customer to create a report for.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
Dim cryRpt As New WorkOrderCompleted_ForOneCustomer
cryRpt.Load()
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
crParameterDiscreteValue.Value = customerNameComboBox.Text
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("CustomerName")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CustomerReportCRV.ReportSource = cryRpt
End Sub
When I run the the application I am not getting the current information from the sql database until I hit the refresh button and enter the parameter. I would like the information to be up to date when first loading the application.
If someone can help me that would be great.
View the full article