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
Here I amHere I am 

How to schedule report in excel/csv format

Hi All,

I would like to schedule report in excel/csv format to the corresponding users.
As of now i can schedule report to the suers but they can see in the email body and the its taking toomuch time to open the data because of report data. due to the reason i am planing to send in excel or csv format.

can any one help me 

Thanks,


 
Best Answer chosen by Here I am
PERFECTIONISTPERFECTIONIST
Heay Here,

We got your request, but as of now as per the standard salesforce functionality you may not able to schedule report in exce/csv/pdf format but you can achieve this by writing apex and triggers.

if you want there is some free tools are available but those are only 30 days trail versions.

please find the below link http://www.cloud4j.com/report-builder-new-features.html

Thanks

All Answers

PERFECTIONISTPERFECTIONIST
Heay Here,

We got your request, but as of now as per the standard salesforce functionality you may not able to schedule report in exce/csv/pdf format but you can achieve this by writing apex and triggers.

if you want there is some free tools are available but those are only 30 days trail versions.

please find the below link http://www.cloud4j.com/report-builder-new-features.html

Thanks
This was selected as the best answer
Here I amHere I am
Hi Perfectionist,

Thanks for your prompt response.

This information helps me to reduce my pain

 
Yury BondarauYury Bondarau
Hi,
You can just configure scheduled dashboard but format of report will be html. For more details about Scheduled Dashboards  https://help.salesforce.com/apex/HTViewHelpDoc?id=dashboards_schedule_refresh.htm
Osvald MarkusOsvald Markus
To reduce your pain in a scheduled import/export of Salesforce data into CSV format take a look at Skyvia Data Loader (https://skyvia.com/data-integration/salesforce-data-loader). It`s cloud-based solution for no-coding integration with broad mapping and flexible scheduling features.
Marie Bertaud 5Marie Bertaud 5
Hello, you can use the following code in a schedulable batch to send a Report in an Excel Format :
Report report = [SELECT  Id,DeveloperName FROM Report WHERE DeveloperName = 'Name'];

ApexPages.PageReference reportPage = new ApexPages.PageReference('/'+report.Id+'?excel=1&isdtp=p1'); 

//Generate Attachment 
Messaging.EmailFileAttachment csvAttachment = new Messaging.EmailFileAttachment();
csvAttachment.setFileName('Report.xls);
csvAttachment.setBody(reportPage.getContent());
csvAttachment.setContentType('application/vnd.ms-excel');

//Generate Email
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[]{'test@test.com'};
String subject = 'Your Subject';
email.setSubject(subject);
email.setToAddresses(toAddresses);
email.setPlainTextBody('Your text here.');
email.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAttachment});
Messaging.SendEmailResult[] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[]{email});

 
Michael TomarMichael Tomar
Hi! I'd like to advise you Skyvia. It provides a powerful functionality for exporting/inporting CSV files to Salesforce: https://skyvia.com/data-integration/salesforce-csv-file-import-and-export
Scheduling is a really important feature, it saves time and efforts significantly.