locked
Passing AccountName to SSRS report using CRM 4.0 RRS feed

  • Question

  • Hi All,
    I created a simple ssrs report and the report accepts Account Name as parameter and display the result from FilteredAccount view.
    The report is working fine  by using the below query .
    My question is :--
    From SPECTRUM application I am selecting a particular Accountname . I open the Account details in another window by double clicking on that AccountName link. Now I am Opening the SSRS which I created report from Report menu. When I select the Report from menu , the reports opens up.
    The problem is when report opens up, It does not populate the Account Name automatically in the SSRS report as parameter value.
    I have to enter manually the Accountname as parameter in SSRS report to Run or view the output.
    Please suggest.


    DECLARE @SQL nvarchar(4000)
    DECLARE @CRM_FilteredAccount nvarchar(2000)

    Set @CRM_FilteredAccount = 'Select FilteredAccount.* FROM FilteredAccount where accountratingcode >= 1'

    SET @SQL = 'SELECT CAST(accountid as nvarchar(100)) as AccountID, name as AccountName

    FROM ('+@CRM_FilteredAccount+') AS CRMAF_FilteredAccount    where  name   in  (''' + @AccountName   +''')'

    EXEC (@SQL)

    Thursday, January 7, 2010 4:07 PM

Answers

All replies