function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MrSalesForceMrSalesForce 

View report button on filtered reportChart in lightning

Hi Friends, 

I have added an <analytics:reportChart to a visual force page. Im using a filter for the visualforce page to be context aware. This works great in classic and it renders in Lightning as well...
 

<!-- Active credit limit report (stored in S: Embedded reports folder) -->
        <analytics:reportChart reportId="00O25000000Sfwa" cacheResults="false" filter="[{column:'FK_NAME',operator:'equals',value:'{!Credit_Group__c.Name}'}]" size="small"></analytics:reportChart>

... however, in lightning you get a bonus button called "view report". This button is great if it works. The problem i have is that the button open the source report without any filter. This cant happen since the report will suddenly show all records in the database and confuse my users.

a) Is there any way to get the "view report"-button in lightning to actually use the same filter as the graph? 
OR 
b) Anyone have a creative way of hiding/removing the "view report"-button?

Lightning view = 

User-added image

Classic view = 

User-added image
 

Alain CabonAlain Cabon
Hi,

a)  New URL links in your VFP:  https://help.salesforce.com/articleView?id=reports_filter_url.htm&type=5

https://na1.salesforce.com/lighting/r/Report/00O25000000Sfwa/view?t=1479844235107&fv0={!Credit_Group__c.Name}

Given that fv0 is the first filter for the column:'FK_NAME' in the report.

b) Analytics:reportChart in Visualforce Page Report Read Only​

https://developer.salesforce.com/forums/?id=9060G0000005WtJQAU
 
Prateek Bharadwaj 1Prateek Bharadwaj 1
Hi MrSalesforce,

Were you able to figure out a solution?
I have a similar requirement but I am unable to find anything over the internet.
Avijit Chakraborty 41Avijit Chakraborty 41
See my answer if anyone is still looking for it, as there is no other way to draw charts in lightning 
https://salesforce.stackexchange.com/questions/46269/visualforce-reportchart-can-we-disable-access-to-report-behind-it/394742#394742