In Visual basic.net 2017
I have an Report called "Servicereport" in this report i have added an parameter that i gave the name "reg"
I drag the parameter into the reportform so i get a textbox.
In my application i have in form2 an textbox called "RegnrTextBox" that are conntected to a access database.
I simple want to transfer the text from my textbox"RegnrTextBox" to my parameter in the report
Ive tried the following
Imports Microsoft.Reporting.WebForms
Private Sub ReportViewer1_Load(sender As Object, e As EventArgs) Handles ReportViewer1.Load
Dim p As ReportParameter
p = New ReportParameter("Reg", Form2.RegnrTextBox.Text)
ReportViewer1.LocalReport.SetParameters(p)
End sub
Did not work.
HResult=0x80004002
Message=Unable to cast object of type 'Microsoft.Reporting.WebForms.ReportParameter[]' to type 'System.Collections.Generic.IEnumerable1[Microsoft.Reporting.WinForms.ReportParameter]'.
Source=WranglerMangement
Also tried a simple line
Servicereport.SetparameterValue("reg",Form2.RegnrTextBox.Text);
no luck their either.
any more suggestions ?
User contributions licensed under CC BY-SA 3.0