none
Error While Attempting To Run A Report RRS feed

  • Question

  • hi

    I am trying to run a report that I have created in vb17. It has one parameter only. It is defined but I get

    error "An attempt was made to set a report parameter that is not defined in this report".

    Someone can help with this?

    thx

    Monday, March 18, 2019 11:55 PM

All replies

  • Hi,

    Welcome to MSDN forum.

    What's the project did you use? Can you share some sample to help us better you and test it?

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 19, 2019 8:51 AM
  • hi Joyce

    here is code in form. won't let me send rpt image

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
           
            Me.CM_RTableAdapter.Fill(Me.DataSet_CM.CM_R)

            strRpt_Title = "CM Report"

            'Create Report Parameters.
            Dim pInfo As Microsoft.Reporting.WinForms.ReportParameterInfoCollection

            Dim paramList As New Generic.List(Of Microsoft.Reporting.WinForms.ReportParameter)

            paramList.Add(New Microsoft.Reporting.WinForms.ReportParameter("Rpt_Title", strRpt_Title, True))
       
            ReportViewer1.LocalReport.SetParameters(paramList)

            pInfo = ReportViewer1.LocalReport.GetParameters()

            ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.Normal)
            ReportViewer1.PrinterSettings.DefaultPageSettings.Landscape = True

            Me.ReportViewer1.RefreshReport()

        End Sub
    End Class




    • Edited by vb17newbie Tuesday, March 19, 2019 11:19 AM
    Tuesday, March 19, 2019 11:16 AM
  • Hi,

    Your issue is related to VB development, I will move your case to appropriate forum to seek for better support. If you have problem about visual studio IDE, please feel free to let me know.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 20, 2019 6:02 AM
  • hi Joyce

    here is code in form. won't let me send rpt image

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
           
            Me.CM_RTableAdapter.Fill(Me.DataSet_CM.CM_R)

            strRpt_Title = "CM Report"

            'Create Report Parameters.
            Dim pInfo As Microsoft.Reporting.WinForms.ReportParameterInfoCollection

            Dim paramList As New Generic.List(Of Microsoft.Reporting.WinForms.ReportParameter)

            paramList.Add(New Microsoft.Reporting.WinForms.ReportParameter("Rpt_Title", strRpt_Title, True))
       
            ReportViewer1.LocalReport.SetParameters(paramList)

            pInfo = ReportViewer1.LocalReport.GetParameters()

            ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.Normal)
            ReportViewer1.PrinterSettings.DefaultPageSettings.Landscape = True

            Me.ReportViewer1.RefreshReport()

        End Sub
    End Class




    Hi,

    1.Does the Name of the ReportParameter match the parameter name in the Report?

    https://stackoverflow.com/questions/13882171/an-attempt-was-made-to-set-a-report-parameter-name-that-is-not-defined-in-this

    2.or try to call ReportViewer.Reset() before loading the new report

    https://stackoverflow.com/questions/13681915/microsoft-reporting-parameters-not-reset

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 20, 2019 7:01 AM
    Moderator
  • VB2017 IS GARBAGE
    Thursday, March 21, 2019 2:40 PM