SSRS 2008R2 Data set Properties Error

  • I have a stored procedure which i have to design the report for this i have connected to the datasource and in dataset properties i have selected the sp and tried to refresh the fields i have given the parameters also but after sometimes error message is giving that

    (could not create a list of fields for the query.Verify that you can connect to the data source and that your query syntax is correct)

    But the stored procedure is running and data is also comming correctly when i execute in sql

  • does the account running the datasource have access to run the proc?

  • Yes the datasource have access to run the proc i have designed so many reports using the same datasource and same database.

    Another thing is when we select new report option and select this sp and execute data is comming but after clicking ok it is coming out of the screen.

    If we select existing item option and select this sp that error message is comming

  • I know That's usually a different error message by do you have any duplicate column names? Maybe there are some column names that BIDS doesn't like?

  • One issue with stored procedures in reporting services is that if the stored procedure is quite complex, e.g. has multiple select statements, that SSRS has trouble parsing them correctly to determine the columns.

    The usual workaround for that is to put a 'dummy' query in the very beginning of the stored procedure that has the same columns & datatypes as are returned by the procedure. SSRS will start to parse the stored procedure, get to that first select query and then use it as the columns for the report.

    This BOL article has the key info:

    See the heading "Understanding Report Datasets and Queries"

    "If multiple result sets are retrieved through a single query, only the first result set is processed, and all other result sets are ignored".

    It is also possible to explicitly set the columns required for the query (edit dataset properties and then "fields") and set the stored procedure as the dataset query without executing the query or letting it refresh fields.I don't recommend doing that though, the other way is easier. You just have to make sure that if you change your SP that you also change the dummy query to keep the fields the same as those that are actually returned.

  • One issue with stored procedures in reporting services is that if the stored procedure is quite complex, e.g. has multiple select statements, that SSRS has trouble parsing them correctly to determine the columns.

    Very true. You may have a SP with branched logic.. IE...

    If @var <5

    -- do something

    select col1, col2, col3

    else if @var>=5 <10

    --do something else

    select col1, col2, col3, col4

    else

    --do this instead

    select col1, col2, col3, col4, col5

    This creates confusion when SSRS is trying to create the dataset columns.

    ----------------------------------------------------

Viewing 6 posts - 1 through 5 (of 5 total)

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