Nov 16, 2010

Dynamic Reports In Salesforce

Hi All,

This is about how we can create dynamic reports in salesforce .

Suppose if we want to show two reports with filter "Account Name equals abc" and "Account Name equals xyz". So there is no need to create two different reports for it, we can pass filter value in URL at runtime.

Now create two link which will redirect to a VFP, with the filter param value by which report will be filtered. Now this VFP will redirect to report URL, e.g https://....../<reportId>?pv0=paramValue. Value passed in pv0 will automatically become the filter value for the report. Now if I pass ?pv0=abc report will show me all account with name "abc" and if I pass ?pv0=xyz report will show me all account with name "xyz".

Like this if we have more than one filters then we can also pass values for them like pv0 , pv1 , pv2 and so on.



  1. Hi, i have created a custom link on account detail page. the link works fine if there is no white space. this link works fine as it is an account "test agency" but it failed to pull the report when the account name is "test agency, LLC". the link is rendered as when i look the look report it removes the space between comma and LLC. please help.

    1. Add HexaDecimal value for Space and Comma followed by %.
      Check the values here --->
      Example: %20, %2D,...

  2. This comment has been removed by the author.

  3. Hi,

    We are facing a problem for passing dynamic filter values to reports from partner communities. We have tried all the combinations of pv0 and fv0. It is working fine in a full org but filters are not being applied when we are trying it from partner communities.

    Any help would be appreciated.