locked
pass parameter from crm 4 to report server RRS feed

  • Question

  • hi all,

    i have a report which display specific account

    i need to select one record and view the report 

    so how can i pass account id to report server


    foreach(object HeartBeat in me.heart.Beats) messageBox.show("I love u !!")
    Wednesday, June 9, 2010 11:19 AM

Answers

  • Hi Dany,

    What u mean report server through sql server? in order to create a custom report(which i think you are doing) you have to create it in VS 2005/2008 and deploy it through MS CRM, well offcourse finally it will be deployed to Reporting Server. But if you use Fitlered View this is the way to use it.

    In other case you have to create custom report parameters, which i think is really not required.


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    Wednesday, June 9, 2010 11:55 AM

All replies

  • Hi, if this report is build in MS CRM and u are using Fitlered Views and use CRMAF_FilteredView, it will be automatically filetered depending on the context. This means the same report can be run for one account from entity view and for multiple views using the MS CRM Grid. see below

     

    Filtering Data using CRMAF_FilteredEntity

    To enable a report for filtering, you can alias entity tables by using an alias name in the format CRMAF_FilteredEntity.

    For example, to alias a table name through code in an SQL query, use the following SQL statement:

    SELECT column1, column2, columnN
    FROM FilteredAccount AS CRMAF_FilteredAccount

    When any entity table names are aliased, the Advanced Find user interface is automatically included in the deployed report when it is run from Microsoft Dynamics CRM.

    To alias an entity table name in Query Builder, right-click each table in your report, click Properties in the shortcut menu, and enter the alias value in the form CRMAF_FilteredEntity, for example, CRMAF_FilteredAccount.

    Explicit Filtering that uses CRM_FilteredEntity

    When you use dynamic SQL, filtering through Advanced Find is enabled by creating a hidden parameter named CRM_FilteredEntity, for example, CRM_FilteredAccount, and by using this parameter in a dynamic SQL query expression. This parameter enables filtering on the table data obtained from the specified filtered view, for example:

    DECLARE @SQL nvarchar(4000)
    SET @SQL = '
    SELECT * FROM ('+@CRM_FilteredAccount+') AS FA'
    EXEC (@SQL) 

    Passing of Filters in Filter Summary

    A filter summary displays the value of the filter that is used when a report is run. In standard Microsoft Dynamics CRM reports, it is displayed as a Textbox report item in the report header that contains the filter text value. When the user runs the report, the Report Viewer displays an Edit Filter button. When the button is clicked, it enables the user to define a data filter. An example of a filter summary can be found in the User Summary report that is included with Microsoft Dynamics CRM.

    To add a filter summary to a report, follow these steps:

    1. Create a hidden string parameter called CRM_FilterText.
    2. Add a Textbox report item to the report and set its Value property: =Parameters!CRM_FilterText.Value.

    When the report is run, the value of the CRM_FilterText parameter will be set by the system to the text of the current filter.

     


    Muhammad Ali Khan
    http://malikhan.wordpress.com

    Wednesday, June 9, 2010 11:38 AM
  • hi Muhammad 

    i'm using Report server through SQL Server.


    foreach(object HeartBeat in me.heart.Beats) messageBox.show("I love u !!")
    Wednesday, June 9, 2010 11:49 AM
  • Hi Dany,

    What u mean report server through sql server? in order to create a custom report(which i think you are doing) you have to create it in VS 2005/2008 and deploy it through MS CRM, well offcourse finally it will be deployed to Reporting Server. But if you use Fitlered View this is the way to use it.

    In other case you have to create custom report parameters, which i think is really not required.


    Muhammad Ali Khan
    http://malikhan.wordpress.com
    Wednesday, June 9, 2010 11:55 AM