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
Rick MacGuiganRick MacGuigan 

How to get the Report ID's 18 characters

How do you get the '18' character id for a 'report?' Not the account Id.
I'm trying to look at the source for a report using the following URL but it's failing becase I only have the 15 character id of the report.

/services/data/v29.0/analytics/reports/00OJ0000000e1R1/describe
Best Answer chosen by Rick MacGuigan
Rick MacGuiganRick MacGuigan
Discovered that you don't even need th e18 character reportID. Salesforce help should be updated . 

But if you need to have the 18 character ID's here are some helpful links:

15 – 18 char converter:
http://www.adminbooster.com/tool/15to18
 
Presentation slides on report classes
http://files.meetup.com/12723112/PeterKnolle_2014_APR_03_LVSFDCDUG.pdf


Heres the solution to save others tons of time:
Using the <analytics:reportChart> Apex component
http://www.salesforce.com/docs/developer/pages/Content/pages_compref_analytics_reportChart.htm
 
<apex:page standardController="Audit__c" showHeader="true" >
<apex:panelGrid columns="3" id="theGrid">
 
<analytics:reportChart reportId="00OJ0000000e1R1" size="tiny" showRefreshButton="true"     filter="[{column:'Audit__c.Name',operator:'equals',value:'{!Audit__c.Name}'}]"/>
<analytics:reportChart reportId="00OJ0000000e2FB" size="tiny" showRefreshButton="true" />
<analytics:reportChart reportId="00OJ0000000e0o4" size="tiny" showRefreshButton="true" />
              
</apex:panelGrid>
</apex:page>

Where:
  • filter="[{column:'Audit__c.Name',operator:'equals',value:'{!Audit__c.Name}'}]"/>Column value is the object name associated with the report column
  • Operator is the comparison operand
  • Value is what the column value must equate to . This can be a merge field, text, number……To find the column value do the following:
Open salesforce Workbench at : https://workbench.developerforce.com/restExplorer.php
Log into your salesforce or (test, production,….)
Select ‘Utilities’ from the top menu
Select  REST Explorer
Click the Execute button
Drill down to the ‘reportMetadata | detailColumns
The column value will be the name associated with the position (left to right) where the index starts at ‘0.’ 

User-added image
 

All Answers

ShashankShashank (Salesforce Developers) 
Hi,


Create a new custom formula field for the object you are interetsed in and in the box for the formula enter

CASESAFEID(Id)

This will return the 18 digit ID which you can then use in your reports.

Thanks,
Shashank
 
Rick MacGuiganRick MacGuigan
Shashank - thanks but we are looking for the Report ID not the object record ID.

I am trying to run this URL in order to build the filter for the visual force component: https://cs10.salesforce.com/services/data/v29.0/analytics/reports/00OJ0000000e1P0MAI/describe
getting this error: INVALID_SESSION_ID Session expired or invalid

Cannot provide reports on visualforce page embedded on custom object. It does not filter by the ID of the object. Need to use this filter on analytics:reportChart>

Need to build the filter attributeName on the < analytics:reportChart> to build the id name to filter on .

Any ideas ???
Rick MacGuiganRick MacGuigan
Discovered that you don't even need th e18 character reportID. Salesforce help should be updated . 

But if you need to have the 18 character ID's here are some helpful links:

15 – 18 char converter:
http://www.adminbooster.com/tool/15to18
 
Presentation slides on report classes
http://files.meetup.com/12723112/PeterKnolle_2014_APR_03_LVSFDCDUG.pdf


Heres the solution to save others tons of time:
Using the <analytics:reportChart> Apex component
http://www.salesforce.com/docs/developer/pages/Content/pages_compref_analytics_reportChart.htm
 
<apex:page standardController="Audit__c" showHeader="true" >
<apex:panelGrid columns="3" id="theGrid">
 
<analytics:reportChart reportId="00OJ0000000e1R1" size="tiny" showRefreshButton="true"     filter="[{column:'Audit__c.Name',operator:'equals',value:'{!Audit__c.Name}'}]"/>
<analytics:reportChart reportId="00OJ0000000e2FB" size="tiny" showRefreshButton="true" />
<analytics:reportChart reportId="00OJ0000000e0o4" size="tiny" showRefreshButton="true" />
              
</apex:panelGrid>
</apex:page>

Where:
  • filter="[{column:'Audit__c.Name',operator:'equals',value:'{!Audit__c.Name}'}]"/>Column value is the object name associated with the report column
  • Operator is the comparison operand
  • Value is what the column value must equate to . This can be a merge field, text, number……To find the column value do the following:
Open salesforce Workbench at : https://workbench.developerforce.com/restExplorer.php
Log into your salesforce or (test, production,….)
Select ‘Utilities’ from the top menu
Select  REST Explorer
Click the Execute button
Drill down to the ‘reportMetadata | detailColumns
The column value will be the name associated with the position (left to right) where the index starts at ‘0.’ 

User-added image
 
This was selected as the best answer
Rick MacGuiganRick MacGuigan
@Terry G Great. Give it a thumbs up !