Results 1 to 4 of 4

Thread: Random Reportviewer error

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2004
    Posts
    19

    Random Reportviewer error

    hi all. I wonder if anyone has encountered a similar situation and knows why I sometimes get the error shown in the image. Most of the time, the report is shown as expected but some of the time (randomly), I get the error. What is causing this issue? Is this a Reportviewer bug? Thanks in advance.

    Name:  forvbforumspic.jpg
Views: 176
Size:  9.4 KB

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,638

    Re: Random Reportviewer error

    Please provide the relevant code and a sample report. Also, you should be aware this forum might change an image's size. The text is almost unreadable. Perhaps cropping it would be a good idea? Also, it's usually possible to select and then copy-paste text, which makes a screenshot unnecessary to begin with.
    Last edited by Peter Swinkels; Oct 8th, 2022 at 02:56 PM.

  3. #3
    Lively Member
    Join Date
    Aug 2014
    Posts
    65

    Re: Random Reportviewer error

    For Peter (and the rest) it says (sorry for posible the typing mistakes since I am typing and viewing it on my phone)
    An error occurred during local report processing.
    An unexpected error occurred in report processing.
    Value cannot be null.
    Parameter name: input.
    For vinz915: From what I read you a contol of variable which you called "input" . When you received this error the control of variable "input" was empty during the report making. It could be because you didn't fill in a field. Or maybe you tried to calculate something impossible like two + 2 (a computer can't calculate with text). Or maybe because a condition isn't correct and the program skips that part of the program.

    The best solution I can give at the moment is to fill in the report until you get an error. Repeat this with debugging and then see why "input" remains empty.

  4. #4
    Addicted Member
    Join Date
    Jan 2013
    Posts
    143

    Re: Random Reportviewer error

    There's a report parameter in the rdlc file that is null and you set the parameter in the rdlc file not to accept null.

    You have two choices:

    1. Either you change the parameter setting so it accepts nulls.

    2. Or you make sure (from your code) that the parameter will never be null.

    Choice 1. See the attached image
    Attachment 185971

    Choice 2. Do something like this:

    Declare YOUR_VARIABLE
    Assign a value to YOUR_VARIABLE
    Check that YOUR_VARIABLE is not null
    Then send the value to the report like usual

    Code:
    Dim param As New ReportParameter("input", YOUR_VARIABLE)
    ReportViewer1.LocalReport.SetParameters(param)
    I recommend following choice 2 because if you followed choice 1 no error will appear but you will get empty cells in your report when the variable is null

    Hope that helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width