Blog Post

Passing BIGINT data to SSRS Sub Report

,

Few days back one of my team mate complained to me that one particular sub report is failing randomly with

Error: Subreport could not be shown

The particular sub report was called from another report’s tablix control column. It accepts  a parameter whose base data type in SQL SERVER database was BIGINT. Since SSRS does not have BIGINT, the parameter type was set to FLOAT.

As mentioned by my colleague, the sub-report was failing for some particular rows. I thought this might be an issue due to mis-handled scenario in the sub-report. I went thru the code and everything worked fine. I just ran the sub-report as stand-alone and that too worked fine. Spent more that 4 hrs and tried many things but neither could find the issue nor get the report working.

At last I was able to identify the issue. When we pass a BIGINT value as a parameter to SSRS sub-report, even though the parameter type is float seems it does not accept the value.

Here is what I did. I created a main report (Report2), with one parameter. I am passing this parameter to a dataset which in-turn inserts it into a temp table. This dataset is binded to a tablix, which calls a sub-report (Report3) and passes this value.

The sub-report just prints the value.

When I supplied a value , say 2127762734, it worked fine.

However when I supplied a value , say 2327762734, it failed even though the sub report parameter was set to FLOAT.

This seems strange and I could not find the root cause. Another strange thing I observed is that when the value is hard-coded (instead of inserting into temp table) it worked fine like in the below screenshot.

 

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating