+ Start a Discussion
EMS Consulting 3EMS Consulting 3 

Click custom button to open report from custom object

Hello,
I created a custom button (on a custom object) to open a visual force page. I have that working, but not sure how to embed the report on the visual force page. I want to show a report on this visualforce page, but I don't know what code to use.

Any help is appreciated.  The code there now is:
<apex:page showHeader="false" sidebar="false"> <apex:outputPanel id="MissingAttRpt" > <apex:iframe src="/00O41000005csO8?isdtp=lt" scrolling="true" height="1588px" width="100%"/> </apex:outputPanel> </apex:page>
Pankaj MehraPankaj Mehra
Hi,

There are couple of ways:

1. Get report data and display on page:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_analytics_report_data.htm

2. Use the code that you are using
<apex:page showHeader="false" sidebar="false">
  <apex:iframe src="/00O900000020jcA"/>  <!—Red mark is Report id -->
</apex:page>

Use this link, its a little bit advance version
https://vanityforce.wordpress.com/2011/10/10/displaying-a-report-within-visualforce/

3. Redirect to the orignal report page on load, or instead of opening VF page paste the Report link on object's button itself.