Dynamic Parameters

  • Hi All,

     I am stuck with a report, could you please help.

     I have a dynamic stored procedure, which depending on Begindate and Enddate displays columns deptname and amount (depending on the month the amount field is going to sum and display the results in the appropriate date column), that is sum(amount) in Jan05,Feb05,Mar05........depending on the Begindate and Enddate, it's displays the values.

     EX:-

    Deptname         Jan 05   Feb 05  Mar 05

    Housing                     5   5          5

    Shipping            45         56         85

    Handling            10         14         18

     

    How do i incorporate this into the Report designer, because when i use this Stored procedure and create a report, i can see the values coming in the Dataset, but i don't see the Amount values coming into the Preview Page.I only see deptname coming into the Preview page.

     I am building a string in the Stored procedure.(Just Letting you know)

    what can i do to make the amount values be displayed under appropriate month.

     Thanks,

    vnswathi.

  • Try this tutorial.

    http://www.codeproject.com/dotnet/DynamicReport.asp

    Or use a matrix control instead of a table control.

  • I will try that.

    Thank you,

    vnswathi.

  • The link is helpfull only if you are know the range of the columns user is going to enter, that is the range in the example above is five so we can already create 5 columns, but for me they will enter date range, so the number of columns is not fixed.

    Any help is greatly appreciated.

    Thanks,

    vnswathi.

  • Go For matrix type report in the report wizard .assuming the month is also one column.try to get the month for each date in query and give the month column in column of the matrix.to achieve the month column in the query .use UDF

    Want to know about matrix , go for msdn.you can go for matrix, when and when only when you use report wizard, you won't find it out side

    Thank you

    Raj Deep.A

  • Yes, when you are not definite about the number of columns that are generated by the sp resultset, MATRIX is the best control supported by SSRS for rendering the dynamic columns. However you need to modify your stored procedure to display the results in a different format

    DEPTNAME       MONTH   AMOUNT

    HOUSING         JAN05       5

    HOUSING         FEB05       5

    HOUSING         MARCH      5

    SHIPPING        JAN05        45 ..... so on so forth and MAP the Month column to Matrix column and Amount to the data row on the matrix.

     

     

     

    Prasad Bhogadi
    www.inforaise.com

  • Thank you very much, it works.

    Thanks,

    vnswathi.

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

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