lookup error

  • I am using ssrs in visual studio 2022, I work on a report, there is one textbox to use lookup to get section name from section id, everything is working properly, but when I use pdf export, I got section name textbox to display "#ERROR" which is using expression "L00kup". Does anybody know how to fix it?

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • Since this works in the web view but not in the export, the problem is likely that the lookup is returning more than 1 result. SOMETIMES the web interface will accept it and return the first result but exports will never accept it and will give you an error. Are you certain that you are only getting 1 result from your lookup?

    Alternately, if the lookup returns Nothing, then the web side will often render it without issue but the export will give an error.

    AI suggests:

    Web viewer is lenient, PDF renderer is strict regarding nulls and data types.

    Wrap your Lookup expression with IsNothing checks and ensure consistent data types.

    If necessary, precompute values in the dataset to avoid runtime lookups.

    By applying these techniques, your #ERROR should disappear in PDF exports while maintaining proper display on the web.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply