SQLTeam.com | Weblogs | Forums

Report Parameters

: An attempt was made to set a report parameter '@LabelID' that is not defined in this report

    Dim paramLabelIDColl() As ReportParameter
    Dim paramLabelID As ReportParameter

    ReportViewer1.ProcessingMode = ProcessingMode.Local
    If IsRoyalAlliance Then
    Else
        ReportViewer1.LocalReport.ReportPath = "rpt_LS_Shipper.rdl"
        ReportViewer1.LocalReport.DisplayName = "rpt_LS_Shipper"
    End If

    paramLabelID = New ReportParameter("@LabelID", Convert.ToInt32(LabelID))
    'paramLabelID.Name = "@LabelID"
    'paramLabelID.Values.Add(LabelID)
    paramLabelIDColl = {paramLabelID}
    ReportViewer1.LocalReport.SetParameters(paramLabelIDColl)
    ReportViewer1.Show()

===============================================================
rdl --



dsShipper


=Parameters!LabelID.Value





LabelID
rd:TypeNameSystem.Int32</rd:TypeName>



Integer


232780


LabelID

============================================================
Please let me know what you find or suggest. Using VS 2019, Windows 10. Preview of report in my Reports project is fine

If you open the report in design view are you able to see the new parameter under parameters list?
check the dataset.

Yes, I see the dataset and the parameter and report runs fine when I press preview. This is in a Visual Studio report project.

Then, I copy my rdl file to the folder

where my vb Visual

Visual Studio project is and add the rdl file to that project

Can only see the xml but the parameter and dataset are both in the xml