Wednesday, March 28, 2012

NoRows Property in Matrix does not work

I wanted to set the NoRows property for a matrix on a report to inform
the user when this condition occurs. I run the report by supplying
parameters that I am sure returns no data. Specifically, I am
determining the table to query based on user inputs. I provide inputs
that will look for a non existent table. I do an existence check on
the table to see if it is there to prevent a sql server error. If it
finds no table the query is not run. However, given that nothing is
returned the norows property is ignored and I get the error "Invalid
attempt to read when no data is present."
Could it be because the matrix requires an empty dataset back?That is what it was. I now ensure I return an empty dataset if the
table does not exist.

No comments:

Post a Comment