none
problem with parameters reportviewer vb.net RRS feed

  • Question

  • Hi everybody,

    I have a problem quite strange.
    Indeed, I am creating a Rdlc file which works well
    I put some parameters on it using:
             Dim test(0) As ReportParameter

            Dim test2(0) As ReportParameter

     

            test(0) = New ReportParameter("T", "blazbbr")

            test2(0) = New ReportParameter("T2", "bljjjjjjjjjjjjjjr")

     

            ReportViewer1.LocalReport.SetParameters(test)

            ReportViewer1.LocalReport.SetParameters(test2)

             Me.ReportViewer1.RefreshReport()

    Of course, I have set T1 and T2 as report parameters. Put a textbox with a parameters as value.
    It works well.

    Working on another thing (picturebox) and delete it (picturebox).
    I run my program which stuck on

            ReportViewer1.LocalReport.SetParameters(test)
    An error occurred during local report processing.

    No way to start this form again.

    I run another form with a reportviewer which uses also parameters and it works.

    I have absouletly no idea of what's happened.

    Any help is welcomed.

    thank you

    Thursday, May 28, 2009 1:56 PM

Answers

  • After doing and doing the samething, it finally works, curiously.
    Exactly how I described it above.
    thanks
    • Marked as answer by yo57 Friday, May 29, 2009 12:59 PM
    Friday, May 29, 2009 12:59 PM

All replies

  • I don't know if this can be the source of your problem, but there is a mistake in your code.
    Report parameters have to be passed as a single array, so your code need to be corrected this way:

     Dim test(1) As ReportParameter

     test(0) = New ReportParameter("T", "blazbbr")
     test(1) = New ReportParameter("T2", "bljjjjjjjjjjjjjjr")

     ReportViewer1.LocalReport.SetParameters(test)

     Me.ReportViewer1.RefreshReport()
    Thursday, May 28, 2009 2:43 PM
  • Thanks for your answers,
    Nevertheless, It worked like that's also.
    Even with your suggestion, it still does not work.
    weird..
    Thursday, May 28, 2009 7:22 PM
  • After doing and doing the samething, it finally works, curiously.
    Exactly how I described it above.
    thanks
    • Marked as answer by yo57 Friday, May 29, 2009 12:59 PM
    Friday, May 29, 2009 12:59 PM