I successfully achieved the report according to Asynchronous Reports with the Analytics API in Apex. I am using synchronous report and it work fine as code below :
global class
public with sharing class ReportManager {
public static Reports.ReportResults getReportResult(Id reportId){
Reports.ReportResults result = Reports.ReportManager.runReport(reportId, true);
return result;
}
}
controller class
public MyReport_Ctrl(){
List<Report> lstReport=[Select Id ,Name from Report Where Name in ('My Active Contact')];
for(Report r :lstReport ){
Reports.ReportResults report = ReportManager.getReportResult(r.Id);
mapReport.put(r.Name,report);
}
myReport =mapReport.get('My Active Contact');
}
visualforce page snippet
<table>
<thead >
<apex:repeat value="{!myReport.reportMetadata.detailColumns}" var="colName">
<th class="headerRow"><apex:outputText value="{!myReport.reportExtendedMetadata.detailColumnInfo[colName].label}"/></th>
</apex:repeat>
</thead>
<tbody>
<apex:repeat value="{!myReport.factMap['T!T'].rows}" var="row">
<tr class="dataRow">
<apex:repeat value="{!row.dataCells}" var="cell">
<td><apex:outputText value="{!cell.label}"/></td>
</apex:repeat>
</tr>
</apex:repeat>
</tbody>
</table>
I noticed in actual report First Name, Account Name , Last Name is an hyperlink.How to retrieve the hyperlink and include in the report that I created in visualforce?