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
SunilKumar.ax1648SunilKumar.ax1648 

How i can show public folder Reports to out site of sales force?

Hi All,

 

how i can show the reports out side of salesforce. i have written Apex classes and VF page for show out report to out side o fsalesforce. if any one have any idea please help me

 

thanks,

sunil

ItswasItswas
Hi Sunil,

If you have to show the reports present inside salesforce in a tabular format then you can use below query inside apex controller
" SELECT Description,Id,Name FROM Report " and use <apex:pageBlockTable. in VF page of pageEditor.

Regards,
Itsaws
SunilKumar.ax1648SunilKumar.ax1648

Hi ,

i have follow same approch , i am able to show report in side of salesforce. it will accesssible but when i am go on site URL it is not open there. here is my code i have written in .....

 

 

public class UtilityReportController
{
public String s{get;set;}
public List<Report> rptsList {get;set;}
public UtilityReportController()
    {
        List<Folder> ff = [select id from folder]; //where developername = 'Community_Inventory_Tool_Reports'];
         id fid =ff[0].id;// (ff.isEmpty()) ? null : ff[0].id;
        rptsList = [select id, name, description from report];// where ownerid = : fid and ownerid != null order by name];
       // return (rpts.isEmpty() == null) ? null : rpts; 
       
       /*for(Report r :rptsList)
       {
           ApexPages.PageReference report = new ApexPages.PageReference(r.ID+'?csv=1');
           System.debug(' :: ID :: '+r.id+':: Name :: '+r.Name);
       }*/
       
    }
    public PageReference reportCSV()
    {
       
       String id  =  Apexpages.currentPage().getParameters().get('id'); 
        
       System.debug(':: id :: '+id);
       ApexPages.PageReference report = new ApexPages.PageReference('/'+id+'?csv=1');
       s = report.getContent().toString();
       System.debug('::Report::'+s);
       return null; 
    }
}

//////////////////////// pagees is here........


<apex:page controller="UtilityReportController" >

<apex:repeat var="r" value="{!rptsList}">
<apex:outputLink value="/reports?id={!r.id}" id="report">{!r.Name}</apex:outputLink><br/>
</apex:repeat>
             
</apex:page>



and second page is below....................


<apex:page controller="UtilityReportController" contentType="text/csv#report.csv" action="{!reportCSV}">{!s}
 
</apex:page>


this is my approch which i have follow to show reports to out side of salesforce.