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
AvLavAvLav 

Export report with apex code

Hi all!

 

It is possible to export a report with apex code?
You select a report in a page (from a selectList), then click a "export" commandbutton, and the apex code make the export.  The report is save as an object in salesforce? Where I can find the report sObject?

 

Adam

hisrinuhisrinu

You can't query report as it will not store any of the data in a separate object, however you can use VF to do this.

AvLavAvLav

My problem is the following: I want to use the report data. I would like to send it via webservice. Is there any option to do it with apex code? For example: reportName.export() method or something like that. I know that export make cvs or xls file, I need this file.

And where can I find the (report) query? If I could use the query, my problem will solved.