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
Sushma  RamakrishnanSushma Ramakrishnan 

Need help to disable click on analytics:reportChart

Hi All,

I have made use of analytics:reportChart to display report in my VF page.
my BR is that the user should just be able to view the report but not be able to click on it.
<apex:page standardController="Account" showHeader="False" sidebar="False">  
<script type="text/javascript">
function disableclickfun()
  <apex:pageBlock >
      <apex:pageBlockSection id="TestSpend" title="Test Spend Data Report" columns="1" collapsible="true" showHeader="false">
          <apex:PageBlockSection columns="2" onclick="disableclickfun()" id="rc">          
                 <analytics:reportChart reportId="00Oi0000005damv" size="medium" showRefreshButton="false" cacheResults="false" 
                 filter="[{column:'Test_NAME', operator:'equals', value:'{!$}'}]"  ></analytics:reportChart>
                <analytics:reportChart reportId="00Oi0000005damt" size="medium" showRefreshButton="false" cacheResults="false"
                filter="[{column:'Test_NAME', operator:'equals', value:'{!$}'}]}]"></analytics:reportChart>

Thanks for Any & All Help!
SandhyaSandhya (Salesforce Developers) 

I see in your code that you are not using quotes for 

Try putting quotes and see if that can help you.


And also try to put alert disableclickfun() and see if that method is getting called when you click.

Hope this helps you!

If this helps you, please mark it as solved.

Thanks and Regards

Sushma  RamakrishnanSushma Ramakrishnan
Hi Sandhya,

Thanks for that correction & have added alert too to test.
Yes its hitting that line but still its not stopping a user from clicking on the report.

SandhyaSandhya (Salesforce Developers) 

Please refer below links which have some solutions for the similar issue.

Thanks and Regards