locked
Filtered Report Problem RRS feed

  • Question

  • Hi,

     

    I have a massive query for the report, and I want to use the automatic prefiltering, so if I got a campaign entity, and i am on the form of that campaign, when I click on the report, I do expect the report get the campaignid and filter the sql statement by that campaignid, and instead of bringing me all the results, it just bring me the results with the campaignid I have selected.

     

    I have been trying all the examples you got, like for example in here: http://blogs.msdn.com/crm/archive/2007/01/30/inside-report-prefiltering.aspx, and some other place, but looks like i do not understand how to do it properly....

     

    so lets say my sql statement is like this:

    select CRMAF_FilteredCampaign.campaignid, CRMAF_FilteredCampaign.name from FilteredCampaign as CRMAF_FilteredCampaign

     

    How do i change this sql in order to make it get the proper data related to the campaign entity form from where I am running the report.

     

    Thank you very much,

     

    Sincerely,

     

    Guillermo

    Thursday, May 15, 2008 4:29 PM

Answers

  • does your query include any "dbo"s (for example, does it say dbo.FilteredCampaign, etc)?  I have found that if the query has dbo's in it, the prefiltering does not work, and sometimes they are inserted automatically by SQL query designer.

    Also, are you prefiltering on multiple entities?  This can throw it off too.
    Friday, May 16, 2008 6:28 AM
    Moderator

All replies

  • Guillermo,

     

    I think you need to lose the 'as'. Your statement should be

    FROM FilteredCampaign CRMAF_FilteredCampaign

    withOUT the 'as'.

     

    See if that helps.

     

    Larry

     

    Friday, May 16, 2008 2:36 AM
    Moderator
  • does your query include any "dbo"s (for example, does it say dbo.FilteredCampaign, etc)?  I have found that if the query has dbo's in it, the prefiltering does not work, and sometimes they are inserted automatically by SQL query designer.

    Also, are you prefiltering on multiple entities?  This can throw it off too.
    Friday, May 16, 2008 6:28 AM
    Moderator