SQL Server 2005 - Reporting Services

  • Hi All,

    I have a stored procedure which returns 10 static columns and 5 to 10 dynamic columns which is based on the parameters sent to the stored procedures.

    When I create a .rdl file in VS 2005 with command type as stored procedures and use above stored procedure which returns dynamic columns - it does not provide a preview in the report.

    Is it that we cannot create reports with stored procedures that return dynamic columns?

    Let me know if anyone has faced similar problem and any solution for same?

  • When you say Dynamic columns if mean Temp table columns the short answer is SSRS rejects most temp table code so you need to create either global temp table and test your code. If not create either a view or permanent table.

    Kind regards,
    Gift Peddie

  • I can make a temp table in store procedure but temp table will have varying number of columns based on the parameters passed to stored procedure

    Is below not allowed ? a mixture of Store procedure and text in VS 2003 report template - data tab,

    exec sp_somestoreprocedure (this SP will create a temporary table say 'temp123')

    Select * from temp123

    Do suggest.

  • That may not even be valid in ADO.NET dataset so I don't think SSRS will execute such code for you because it takes trick to get regular local temp table code to run. SSRS runs clean stored procedures and the more ANSI SQL you use the better your reports perform.

    So you need to design your report and create views to use as the source of your data if you cannot use table.

    Kind regards,
    Gift Peddie

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

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