Exporting reports to excel

Introduction

SQL Server Reporting Services (SSRS) has multiple options of exporting data into a variety of formats and we will be
discussing the options of exporting SSRS Reports to multiple sheets of excel. In SSRS, there are multiple formats
available to export reports depending on the user’s needs. Microsoft Word, Microsoft Excel, Microsoft PowerPoint,
Tiff file, MHTML (Web Archive), CSV (comma delimited) and XML file with report data are the popular formats that can
be exported from SSRS as shown in the below screenshot.

Options of exporting in SSRS

As you know, every format has its own features. For example, in Microsoft excel there are sheets that are used to
group the data. Excel savvy users prefer to group the data into sheets. The challenge that many users experience is
exporting SSRS reports to multiple sheets of excel.

There are a couple of scenarios of requirements for exporting SSRS Reports to multiple sheets of excel.

  1. Different Tablix in Different sheets: In this requirement, there will be multiple tables/tablixes that you need
    to export them to different sheets
  2. Same Tablix in Different sheets: In this requirement, the same tablix will have different groups of data. For
    example, sales tablix will have product categories of Bikes, Components, Clothing, and Accessories. This data
    set may require exporting SSRS Reports to multiple sheets of Excel depending on these categories. In other
    words, sheets are dynamic as they depend on the data set

Scenario 1

First of all, let us create a sample report in order to demonstrate the feature of exporting SSRS Reports to
multiple sheets of Excel. Let us launch the Visual Studio or SQL Server Data tool (SSDT) and create a Reporting
server project. Then let us add a report to the newly created SSRS project. Next, we will create a connection by
pointing out the AdventureWorksDW sample database.

Let us create two data sets where one has the bikes data and the other data set has data of clothing. Following is
the query for one data set by joining FactInternetSales, DimProduct, DimProductCategory and DimProductSubcategory.

SELECT TOP (5) DimProductSubcategory.EnglishProductSubcategoryName, DimProductCategory.EnglishProductCategoryName, DimProduct.EnglishProductName, FactInternetSales.SalesAmount, FactInternetSales.TaxAmt,

FactInternetSales.Freight, DimDate.FullDateAlternateKey, FactInternetSales.SalesOrderNumber

FROM FactInternetSales INNER JOIN

DimProduct ON FactInternetSales.ProductKey = DimProduct.ProductKey INNER JOIN

DimProductSubcategory ON DimProduct.ProductSubcategoryKey = DimProductSubcategory.ProductSubcategoryKey INNER JOIN

DimProductCategory ON DimProductSubcategory.ProductCategoryKey = DimProductCategory.ProductCategoryKey INNER JOIN

DimDate ON FactInternetSales.ShipDateKey = DimDate.DateKey

WHERE (DimProductCategory.EnglishProductCategoryName = ‘Bikes’)

This is configured as shown in the following screenshot:

Configuring Queries in SSRS

Similarly, another data set is created for the clothing and two tables are included as follows.

Two Tablix are configured to demonstrate multiple sheets.

Please note that in order to demonstrate, only the top five records are retrieved and the following screen shows the
output of the report.

View of the configured SSRS Report.

When this is exported to Microsoft excel, typically this will be exported to one sheet whereas the requirement is,
exporting SSRS Reports to multiple sheets of Excel. Further, Sheet names should be Bikes and Clothing.

There are three tasks in order to create multiple sheets.

  1. Creating a Page Break after the Bikes table
  2. Naming the Sheets with appropriate names
  3. Repeat the headings on every page

Three different configurations have to be done for this and let us do this configuration one by to implement
exporting SSRS Reports to Multiple sheets of Excel.

To add a page break, go to the properties of the first table or the tablix as shown below.

Configuration of Adding a page break after the first table for Exporting SSRS Report to Multiple Sheets of Excel.

By selecting the Add a page break after, you are adding a page break after this table.

As you know, by default, sheets will be named as Sheet1, Sheet2 etc. However, we would like the name them with a
proper name. For example, we would like to name the sheets as Bikes and Clothing instead of Sheet1, Sheet2.

By selecting the relevant tablix and changing the PageName to Bikes will change the sheet name to Bikes as shown in
the below screenshot.

Allocating the PageNames

Similarly, the page name of the next tablix is named Clothing as shown in the below screenshot.

Naming the Sheet for the Clothing Dataset.

The last option is to repeat the heading on every page. There are several options for that and the very basic option
is, configure the RepeatWith property of the Header text box.

Repeat with option to repeat the header.

The above configuration shows that the header is repeated with the Tablix3. However, if there are more than two
pages, then this option will not work. Instead, we can add a report header by right-clicking and add a page header
and configure as shown in the following screenshot.

Configuring Report Header so that the report header will appear in every page.

Now you are done with the configuration and let us verify this.

When you preview the report, you will see that both tablixs have appeared in two different pages alone with the
header. When you export it to the excel, you will see that data is in separate sheets with the relevant names.
Further, you will see that you will have the header on both sheets.

This is shown in the following screenshot.

Exporting SSRS Reports to Multiple Sheets of Excel.

You will see that there are two sheets with appropriate names instead of default sheet names.

Scenario 2

If you look at the above example, you will see that category is kind of hardcoded. In case, there are new
categories, you need to add them to another tablix along with a new query which will not be a good option.
Therefore, we need the option of exporting SSRS Reports to multiple sheets of excel for dynamic groups.

Let us see the report without any page breaks as shown in the below screenshot.

Multiple groups with out page break.

When you export this to Microsoft Excel, we should see three sheets with relevant names. If there are new categories
added later, those should be seen in a new sheet. This means sheets should be dynamic.

First of all, let us create a grouping with the category name by right-clicking the tablix and adding to

Group by category

We have enabled the Add group header option so that we can use it to repeat the column headers
later. Then move the tablix headers to the group headers and you will the following report after viewing it.

With the Repeated column headers.

Next is to include the page break to the included groups. To do that, go to the properties of the groups from the
following option.

Selecting Group Properties.

In the Page Breaks option, choose the Between each instance of a group as shown in the below image.

Adding the page break for exporting SSRS Reports to Multiple Sheets of Excel.

Now we need to provide the sheet name for when exporting to the Multiple sheets of Excel in SSRS.

Go to the properties of the group and go to Group -> PageName as shown in the below screenshot.

PageName in the Groups.

Since the sheet name is dynamic, it has to be an Expression. In the expression property page, you need to provide
the name of the sheet by combining the dataset fields as shown in the below screenshot.

Dynamic name for the Sheets name which includes the product category

Now everything is set and let us verify whether we get the data in when Exporting SSRS reports to Multiple Sheets of
Excell.

Exporting SSRS Reports to Multiple Sheets in Excel with dynamic sheets.

You will observe that when exporting to multiple sheets in Excel, it can be configured dynamically in SSRS.

Conclusion

SQL Server Reporting Services is one of the most common reporting tools used in many organizations by many users.
SSRS has the option of exporting reports to many formats and Microsoft Excel is the most common format that users
use. However, since Microsoft Excel has the Sheet feature, users would like exporting SSRS Reports to multiple
sheets of excel.

We looked at two options for creating multiple sheets in Microsoft Excel. Initially, we looked at how to create two
separate tablixes into multiple sheets and name the sheets accordingly. Next, we looked at the exporting SSRS Report
to multiple sheets of excel in dynamic nature. In that, we used the Grouping feature of the Tablix.

  • Author
  • Recent Posts

Dinesh Asanka

Dinesh Asanka is MVP for SQL Server Category for last 8 years. He has been working with SQL Server for more than 15 years, written articles and coauthored books. He is a presenter at various user groups and universities. He is always available to learn and share his knowledge.

View all posts by Dinesh Asanka

Dinesh Asanka

You can export report data to Excel or to PDF.

Exporting report data to Excel

Before exporting data to Excel, check that your Excel export settings are configured appropriately.

Configuring Excel export settings

You can choose the Excel file format the report will be exported to – either .xml or .csv. If you choose .csv, you can choose what character is used as a separator in exported CSV files.

To configure Excel export settings:

  1. Click User Settings or the icon located in the bottom, left-hand corner of the page, and click Settings.

  1. From the Report Excel Export Format field, choose .xml if you’re using Excel XP or higher, and .csv if you’re using an older version of Excel.

  1. If you selected .csv format, enter the character that should be used as a field separator in reports exported to Excel.  This field is set to comma (,) by default.
  2. Select Compress Excel Email Attachment if you want email attachments to be compressed and sent as .zip files. This can be useful in decreasing the file size when sending large reports.
  3. Click Save.

Exporting data to Excel

To export data to Excel:

  1. Go to Reports, and open the report whose data you want to export.
  2. Click the  icon in the top, right-hand corner of the report.

The Excel file will be generated.

Exporting report data to PDF

To export data to Excel:

  1. Go to Reports, and open the report whose data you want to export.
  2. Click the  icon in the top, right-hand corner of the report.
  3. Select print options in the dialog that displays.

You can choose the page size, orientation, font size, and margins. You can also choose to include page or column headers, page numbers, and a report header on its own page, and to separate report groupings with page breaks.

  1. Click Export.

The PDF will be generated.

FAQs

Why can’t I open an export in Excel?

The report or export likely uses .xml format. Files of this type often open in a web browser by default, rather than in Excel.

To open this type of report or export in Excel:

  1. Open Excel.
  2. Open a blank workbook.
  3. Select File > Open, and select the report or export file.

Can I set the currency symbol and amounts to appear in different cells in exports?

Yes, you can. To set the currency symbol and amount to display in different cells.

  1. Click User Settings or the icon located in the bottom, left-hand corner of the page, and click Settings.

  1. Select the Separate Currency and Amount check box, which is located at the bottom of the page.

  1. Click Save.

Leading zeros are removed when I export to Excel

By default, Excel removes leading zeros in number fields. But, some users need to retain exported zeros (for use in payroll software, for example).

To work around this:

  1. Select cells with leading zeros you wish to retain.
  2. Right click on the selected cells, and click the Format cells option.
  3. Under the General tab, click Custom.
  4. Type a 0 for each digit you want to retain. For example, type 00000 to retain an imported value of 00121.

Or, you could open exported CSV files in software that retains leading zeros, such as Notepad, rather than Excel.

Some numbers display in date format in the export

Numbers may display using a date format if you export a report using .csv format. To fix this, change your export format to .xml.

Related links

I can’t open an Excel report or export

This article explains how to export a report to XLS format from Preview (Visual Studio, WinForms, WPF), Document Viewer (Web Platforms), and in code. The article also describes export modes and export options you can specify for the exported XLS file.

Note

Export options listed in this article generate WYSIWYG output. Report layouts with misaligned columns, empty spaces, and misaligned headers and footers might produce merged cells and extra columns/rows in the exported XLS file. Refer to the following section for more details: Merged Cells And Extra Columns/Rows: Troubleshooting. To export data to XLS without exact layout replication, use the Spreadsheet Document API instead of the reporting export engine.

Export from Preview (Visual Studio, WinForms, WPF)

You can export a report from the Visual Studio Preview tab, WinForms Print Preview, and WPF Print Preview. Expand the drop-down list of export formats and select XLS File.

Specify export mode and options in the invoked XLS Export Options dialog and click OK.

Export from Document Viewer (Web Platforms)

You can export a report from ASP.NET Web Forms Document Viewer, ASP.NET MVC Document Viewer, or ASP.NET Core Document Viewer. Specify export options in the Export Options dialog, expand the Export To drop-down list in the toolbar, and select XLS.

Export in Code

Use the XtraReport.ExportToXls or XtraReport.ExportToXlsAsync methods to export a report to XLS format. Specify the path/stream to which the report should be exported as the first argument in these methods. If you specify only the path/stream, the report is exported to XLS format with the default options. To change the default options, do the following:

  • If you create a report in code: create a XlsExportOptions object, specify export options for this object, then pass the object to the XtraReport.ExportToXls or XtraReport.ExportToXlsAsync methods as the second argument.
  • If you create a report in the Visual Studio Designer: change the options in the Properties panel.

Example

View Example: Export a Report to XLS Format

  • Form1.cs
  • Form1.vb
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
using System.Windows.Forms;
using System;

namespace XlsExportExample {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e) {
            // Create a report.
            XtraReport report = new XtraReport() {
                Name = "Report Example",
                Bands = {
                    new DetailBand() {
                        Controls = {
                            new XRLabel() {
                                Text = "Some content goes here...",
                            }
                        }
                    }
                }
            };

            // Specify export options.
            XlsExportOptions xlsExportOptions = new XlsExportOptions() {
                ExportMode = XlsExportMode.SingleFile,
                ShowGridLines = true,
                FitToPrintedPageHeight = true
            };

            // Specify the path for the exported XLS file.  
            string xlsExportFile =
                Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) +
                @"Downloads" +
                report.Name +
                ".xls";

            // Export the report.
            report.ExportToXls(xlsExportFile, xlsExportOptions);
        }
    }
}

Export Modes

Use the Export Mode option to specify one of the following XLS export modes.

Single File

Exports a report to a file that contains one sheet with all report pages. The report’s page headers, footers, and top/bottom margins appear only once, at the beginning and end of the sheet.

Single File Page-By-Page

Saves every report page as one sheet. The report’s page headers, footers, and top/bottom margins appear on every sheet.

Different Files

Exports a report to multiple files. Each file contains a sheet that corresponds to one report page. Page headers, footers, and top/bottom margins appear on every sheet.

Export Options

The following options are available in the XLS Export Dialog, which you can open from the Visual Studio Print tab, WinForms Print Preview, WPF Print Preview, and in the Export Options dialog of the Document Viewer (Web platforms):

  • Page Range
  • Sheet Name
  • Text Export Mode
  • Show Grid Lines
  • Export Hyperlinks
  • Raw Data Mode

The options below are available only in the Properties panel in the Visual Studio Report Designer, WinForms End-User Report Designer, WPF End-User Report-Designer, …

… and in the Export options dialog of the Document Viewer (Web platforms).

  • Image Export Options
  • Print Options
  • Encryption Options
  • Suppress Export Exceptions Options
  • Workbook Color Palette Compliance
  • Right-to-Left Document
  • Ignore Errors

Page Range

The Page Range option specifies the range of pages that should be exported to an XLS file. For example, the “1,3,5-12” range exports pages one, three, and five through twelve.

Sheet Name

Use the Sheet Name option to specify the name of the sheet in the exported XLS file. If you use Single File Page-By-Page mode, a consecutive index is added to the name of each sheet in the exported XLS file.

Text Export Mode

Use the Text Export Mode option to specify one of the following XLS export modes for report data:

  • Value (default)

    Exports all data with the same formatting as in the original document. Integer, double, and Boolean values are exported with their original types. All other values are exported as strings. For the XRLabel control, the XlsxFormatString property value is used as a format string. If the property is not specified, the TextFormatString property value is used as a format string.

  • Text

    Exports all data as strings.

Show Grid Lines

The Show Grid Lines option specifies whether sheet gridlines are visible in the exported XLS file.

Export Hyperlinks

Use the Export Hyperlinks option to specify whether to include hyperlinks in the exported XLS file. Only absolute URLs of the following types are supported:

URL Type

Example

Email address

mailto:office@example.com?subject=Inquiries

Web page

https://www.example.com

File

file:///D:/Files/Agreement.html

Raw Data Mode

Enable the Raw Data Mode option to export plain data and ignore images, graphics, font, and appearance settings.

Image Export Options

Enable the Rasterize Images option to rasterize vector images in pictures, charts, and barcodes in the exported XLS file. Use the Rasterization Resolution option to specify image resolution.

Print Options

Enable the Fit To Printed Page Height/Fit To Printed Page Width option to shrink the height/width of the exported document’s printout to one page. Enable both of these options to shrink the width and height of the exported document’s printout to one page.

Encryption Options

Use the Password option to set a password for the exported XLS file. XLS files support ARC4 encryption (except for RC4CryptoAPI). Refer to the following topic for more information: Office Document Cryptography Structure.

Important

Passwords for XLS files are stored as plain text in report definitions. Ensure that only trusted parties have access to report definition files.

Suppress Export Exceptions Options

Use the options below to suppress exceptions that raise if the exported XLS file contains more than 256 columns or 65536 rows:

  • Suppress256ColumnsWarning
  • Suppress65536RowsWarning

Workbook Color Palette Compliance

Use the WorkbookColorPaletteCompliance property to specify color palette compatibility with different workbook versions.

Right-to-Left Document

If you use right-to-left fonts in a report, enable the Right-to-Left Document option to use the right-to-left layout for sheets in the exported XLS file.

Ignore Errors

Use the Ignore Errors option to specify errors that should be ignored in the exported XLS file.

Limitations

Common

  • Values of custom types are not exported to XLS files. If a cell within the exported XLS file contains a value of a custom type, the cell displays the #VALUE! error.
  • An XLS cell may contain up to 32,767 characters. If the control’s Text property contains longer text, the text is truncated in the exported XLS file. No errors or warnings are displayed. Refer to the following Microsoft topic for more information: Excel specifications and limits.
  • Cross-sheet references work in Single File export only.

Single File Mode

  • If a report uses CachedReportSource, changes made in Preview are not included in Single File exports.
  • If a report includes a page merged from another document, you cannot export the report as a Single File. The exported file contains only one of the merged reports. As a workaround, use subreports to combine multiple reports into a single document or export each report to a single XLS file, then join these files into one file.

Overlapped Controls

  • Overlapped controls might produce a corrupted layout in the exported XLS file. In the Report Designer, overlapped controls are shown in red. Move the mouse pointer over these controls to show a detailed export warning:

    ShowExportWarnings

    If you create a report in code, use the HasExportWarningControls collection to check if the report contains controls with export warnings.

  • The XRLabel control placed over the XRPictureBox control is exported to an XLS file under the picture.

The BeforePrint Event

If a control is bound to a data source field and the Text Export Mode option is set to Value, data from this field is exported directly to an XLS file. If you modify the control’s Text property value in the BeforePrint event, the changes are not exported to the XLS file. To modify and export the control’s data, use one of the following techniques:

  • Assign data to the control’s Value property instead of the Text property in the implemented BeforePrint event.
  • Use the EvaluateBinding event instead of BeforePrint. Assign a new value to the e.Value property.
  • Set the Text Export Mode option to Text. Note that all values are exported as strings for this mode.

HTML/RTF Export

You can specify HTML content for the XRLabel control and HTML/RTF content for the XRRichText control. Only the following groups of HTML tags and their RTF equivalents are supported in XLS files:

Tag Group

Tags Example

Text format

<b>, <i>, <u>, <s>

Font settings (name, size, and foreground color)

<font=[font name]>

Line break

<br>

Non-breaking space

<nbsp>

Refer to the AllowMarkupText property description for information on XRLabel HTML tags supported in XLS files. See the following topic for details on HTML tags that XRRichText supports: HTML Support Limitations: Supported and Unsupported Tags.

Export Report Groups to Separate XLS Sheets

This section explains how you can export each data group into an individual worksheet. You can leverage the Single File Page By Page export mode if you take a few preparatory steps.

Do the following to export each report group to separate XLS sheets:

  1. Modify the report layout to place each group on a new report page. Use one of the following methods to separate the report groups:

    • If the groups are stored in one report, use the XRPageBreak control or enable the Band.PageBreak property.
    • If each group is stored as a separate report, use the XRSubreport control with the GenerateOwnPages property enabled.
  2. Fit the content of each group to one report page. To do this, set the XtraReport.RollPaper property to true.

  3. Enable Single File Page By Page export mode to export each page of the report to a separate XLS sheet.
  4. (Optional) Use the XlSheetCreated event to change the default name of each XLS sheet.

Note

You may want these layout changes to be applied only to the XLS export and not to on-screen preview or other export formats. In such cases, we recommend that you create a copy of the report and adjust this copy specifically for XLS export purposes. If you create a report in the Visual Studio Designer, you can customize the report in code.

View Example: Export Report Groups to Separate Excel Sheets

Merged Cells And Extra Columns/Rows: Troubleshooting

Export options listed in this article produce WYSIWYG output. Report layouts with misaligned columns, empty spaces, misaligned headers and footers, and overlapped controls might produce merged cells and extra columns/rows in the exported XLS file. This section describes how you can modify a report layout to resolve these issues.

Misaligned Columns

The image below shows a report with a table whose header’s columns are not aligned with the table cells:

The exported XLS file has the following layout:

Only A, C, E, and G columns are visible. Extra B, D, F, and H columns are added to the exported XLS file. The problem occurs because the table header and the cells in the Detail band are not aligned. The image below shows the borders of the misaligned columns:

To remove extra columns, align header and detail cells horizontally:

Empty Spaces

The image below shows a report with empty spaces between controls:

The exported XLS file has the following layout:

In the image below, cells with exported controls have a yellow background. As you can see, the export generated additional cells to replicate empty spaces between the controls.

To fix this issue, move or resize report controls to eliminate empty space. Use the TextAlignment and Padding properties to adjust text position.

Misaligned Headers And Footers

The image below shows a report with a header in which the control’s borders are not lined up with the report’s table columns.

The exported XLS file has the following layout:

The image below highlights the controls that generate extra columns:

To remove these extra columns, align the controls in the report header and footer to table columns:

Overlapped Controls

The following image shows a report layout with two overlapped labels:

Two overlapped labels

The exported Excel file appears as follows:

Exported Excel file

You can see that an extra column named B appears in the exported file. To remove this column, modify your report layout such that the controls do not overlap.

Modified report layout

After the modification, the exported file does not contain the extra column:

Exported Excel file after modification

Do you need to share your report built in Salesforce with external stakeholders? Or you simply want to visualize your Salesforce data using some external dataviz tool, such as Tableau? There are many reasons why you might want to export a Salesforce report to Excel but the options are quite limited. Read on to find out which tool or solution works best for you.

Export Salesforce report to Excel – methods to consider

  • Manually export Salesforce report to Excel or CSV – this is the native functionality that allows you to manually download Salesforce reports to Excel. You can export formatted reports as Excel files or the raw data as Excel and CSV files.
  • Schedule export of Salesforce data to build custom reports in a spreadsheet – this is the approach for custom reporting. You can automate exports of specific data entities to Google Sheets or Excel. Based on this data, you can create a custom report or dashboard, which will update automatically with every data refresh.
  • Export Salesforce reports via the Salesforce API – this is an advanced approach, which may require coding skills to extract data via the Salesforce API. Alternatively, you can use the JSON to Excel connector. This will let you avoid any coding, but you’ll need to map the exported data in Excel.

We’re going to review each section separately. However, if you already know which of these options to export reports from Salesforce to Excel would work best for you, you can skip right to it.

How to export Salesforce report to Excel natively

We’ll check out the flow separately for each Salesforce UI version.

Note: To export reports from Salesforce, a user must have the ‘Export Reports’ permission.

Related Posts

7 export salesforce contacts salesforce google sheets

5 export buttons salesforce classic

Export Salesforce report to Excel in Lightning Experience

  • Go to the Reports tab and open the report you want to export. 

1 reports tab

  • Click the Edit drop-down menu on the right side of your Salesforce report and select Export.

2 export

  • Select the format for export Salesforce report to Excel
    • Formatted Report is available for export only as XLSX Excel file
    • Details Only is available for export as XLSX or XLS file, as well as CSV

3 fromat type

  • Click Export – the file with your Salesforce report will be downloaded to your device. 

Here is an example of a New Opportunity Trends Report exported formatted from Salesforce Lightning experience:

3.1 New Opportunity Trends Report in excel

Salesforce report export in Salesforce Classic

  • Go to the Reports tab and open the report you want to export. 

4 reports salesforce classic

In Salesforce Classic, reports do not have an Export button with exporting formats. You can choose them right away with the following buttons:

  • Printable View – to export the formatted report in XLS format
  • Export Details – to export the report’s data in XLS or CSV

5 export buttons salesforce classic

For example, here is what a New Opportunity Trends Report looks like if exported as Printable View from Salesforce classic:

6 New Opportunity Trends Report in excel sf classic

The difference between Formatted Export (Lightning Experience) and Printable View (Salesforce Classic) is obvious. 

At the same time, there is no difference if you export report details from both Salesforce UI versions:

7 New Opportunity Trends Report details in excel

This is how you can export a Salesforce report to Excel. Also, check out the restrictions associated with this action.

Salesforce reports for Excel export limitations

  • Up to 5 reports at once.
  • Unlimited number of rows and columns for Details Only reports in XLS or CSV formats.
  • Up to 100,000 rows and 100 columns for Formatted Reports or Details Only in XLSX format. 
  • Historical trending reports are not available for export.
  • Joined reports can include a maximum of 2,000 rows and are available for export only as Formatted Report.

Can I auto export Salesforce report to Excel?

Unfortunately, Salesforce does not allow you to export Salesforce reports to Excel on a schedule. This is rather frustrating because automation would allow you to save much of the time for your reporting tasks. 

However, there is always a solution. Below we’ll introduce a few methods so you can set up automation for your Salesforce reports.

How to export Salesforce report to Excel automatically

In the blog post Salesforce Export Data, we explained how you can schedule exports of data from Salesforce to Excel or Google Sheets. For this, you need Coupler.io, an iPaaS solution that extracts data from apps, such as Airtable, Google Sheets, and so on, and loads it to a chosen destination on a schedule.

Figure 2.4.3. Coupler.io to import data from Facebook into Excel Google Sheets and BigQuery

Coupler.io provides a dedicated Salesforce integration, which allows you to auto export a bunch of data entities including Contacts, Orders, Opportunities, and many more. Reports are also on the list of exportable data entities, but it only exports a list of reports. 

Nevertheless, the method we suggest here is as follows:

  • Export raw Salesforce data required for the report
  • Build a custom report in Excel and link the exported data to it 

This will let you automate reporting on a schedule like every hour or every 15 minutes. Let’s now look at how this works.

Example of how you can connect Salesforce report to Excel

As an example, let’s take the New Opportunity Trends Report that we’ve recently exported manually. For this report, we’ll need information about Opportunity History. To export this data, sign up to Coupler.io, click Add new importer and configure the integration.

Set up source 

  • Select Salesforce as a source application. 
  • Connect your Salesforce account. You will need to log in to Salesforce if you have not already. 
  • Select Opportunity History as a data entity from a drop down list. 

8 source opportunity history 1

Note: You can filter the data to export from Salesforce to Excel using the Advanced filters section, for example, like this:

8.1 advanced filters

Jump to the destination setup.

Set up destination

  • Select Excel as a destination app from the drop-down list. 
  • Connect your Microsoft account.
  • Select a workbook stored on your OneDrive, as well as the worksheet where to load the Salesforce data. Optionally, you can type in a name to create a new sheet.

Here is what the destination configuration may look like.

9 destination setup

Click Save and Run to load Salesforce data to your Excel workbook. Here is how it looks:

10 salesforce data excel

This is just raw data, which you can convert into a report as you wish. 

Build a report based on the Salesforce data exported to Excel

In our example, we inserted a Pivot table to get the format we need.

11 pivot table saleforce report

Here are the steps we took:

  • Added a new column with the End of the Month formula to convert values from the CloseDate column. 

12 eomonth column

  • Inserted a pivot table with the following fields:
    • Rows: StageName
    • Columns: End of Month
    • Values: Sum of Amount
13 pivot table fields

And here is what our custom report looks like compared to the New Opportunity Trends Report that we exported manually from Salesforce to Excel.

14 reports compared

The main benefit of the custom report is that it will be updated automatically with every data refresh that you set up in Coupler.io. So, you can use this method for not only reporting but also other tasks, for example, creating a Salesforce backup copy.

Salesforce schedule report Excel

  • In your Salesforce to Excel integration, toggle on the Automatic data refresh feature.

15 toggle on automatic data refresh

  • Then configure the desired frequency for automated exports.

Coupler.io set schedule for the automatic data refresh

And that’s it! Coupler.io will automatically update data from Salesforce in Excel, so the values in the pivot table will be automatically updated as well.

Note: Pivot table is just an example that we used here. You can create custom reports using Excel functions, Power Query, charts, and other features.

Link Salesforce report to Excel using the Salesforce API

The last option on our list of solutions for exporting Salesforce reports to Excel is the Salesforce REST API. We’ve covered this in more detail in our article on Salesforce Data Export. To do this, you’ll need to complete the following steps: 

  • Create a Connected App in Salesforce
  • Get an access token 

With an access token, you can send a GET request to the following API URL:

curl "{instance-URL}/services/data/{api_version}/analytics/reports/{report-ID} 
  -H "Authorization: Bearer {access_token}"

where:

  • {instance-URL} is the instance URL, which you obtained along with the access token, for example, 
https://zrecords-dev-ed.my.salesforce.com
  • {api_version} is the version of the Salesforce API
  • {access_token} is your access token
  • {report-ID} is the Id of your Salesforce report. You can learn the report ID by opening the report and checking the URL bar. 

Salesforce report ID

This step is more technical since it requires you to work with the Salesforce API documentation, as well as write a script to extract data and map it into your Excel file. 

Alternatively, you can learn how to connect API to Excel without coding.

Do you need the no-code integration for exporting Salesforce reports to Excel?

It’s believed that wishing upon a shooting star makes the wish come true:) Coupler.io suggests that you don’t wait for this moment, but simply let us know whether you need to have the option for exporting reports to Excel or Google Sheets. Fill out this form to submit your request. Many of our integrations came out thanks to the active users who expressed their interest in particular sources. Good luck with your data!

  • Zakhar Yung

    A content manager at Coupler.io whose key responsibility is to ensure that the readers love our content on the blog. With 5 years of experience as a wordsmith in SaaS, I know how to make texts resonate with readers’ queries✍🏼

Back to Blog

Focus on your business

goals while we take care of your data!

Try Coupler.io

SharePoint Online training courses

This Power BI tutorial, we will also disucss different approaches to Export Data in Power BI to excel. We will discuss how to export data from Power BI desktop to excel, Export Data from Power BI Dashboard to excel and Export Data from Power BI Report to excel. We will also see, Power BI Export to Excel Limitations.

Also, We will see Power BI Export underlying data details, how to enable the Export option in Power BI Desktop and what are the limitations and considerations in Power BI Export to Excel.

Learn how to export Power BI reports to PDF.

Different approaches to Export Data in Power BI

In Power BI, you can export the data by using three different approaches as:

  • Export Data From Power BI Desktop
  • Export Data from Power BI Dashboard
  • Export Data from Power BI Report

To export the data from the Power BI Desktop, Click on the visual which you want to export.

Once you will click on the visual, you can see the three dots () which are present at the top right corner of the visual as you can see in the below screenshot. Select Export data from the drop-down.

export power bi dashboard to excel
export power bi to excel

Now it will ask you to save the Excel file. For that, you choose your location where you want to save the excel file and Select the Excel File type as CSV. Then click on Save.

In the below example, I have saved the file name as IncomeTaxRate with the type of CSV File.

export data from power bi desktop to excel
Power bi desktop export to excel

When you will open the Excel file on your desktop, you can see the table like the below screenshot.

As I have saved my file with IncomeTaxRate name, that’s why the Excel spreadsheet name is appearing with the same name as shown below.

power bi export to excel
export power bi to excel

Export Data from Power BI Dashboard

Similarly, you can export the data from the Power BI Dashboard. For that, Go to your particular dashboard where the visual is present that you want to export.

Once you will go to the Power BI Dashboard page, Select your visual and click on the three dots () which are present at the top right corner of the visual. Then select Export data option from the drop-down menu as shown below.

export power bi dashboard to excel
export power bi to excel

When you will select the Export data option, then the below window will appear where you have to choose the Summarized data and the File format as .xlsx (Excel) as shown below. Then click on Export.

Once you will Export, the Excel file will be downloaded and it will be saved as .xlsx file type.

export data from power bi dashboard to excel

While you will open the downloaded Excel file (.xlsx), then the Excel spreadsheet will appear as the below screenshot. Here the Excel spreadsheet name will be the same as of the visualization name.

power bi export to excel xlsx
export power bi to excel

Export Data from Power BI Report

This is exactly similar to the Export Data From Power BI Desktop. Both are the same concept and processes. Here, One of the differences between them is, You have to export the data from the Power BI Report in Browser instead of the Power BI Desktop.

In the same way as Power BI Desktop, In the browser Power BI Report, Select your specific visual which you want to export. Then click on the three dots () and select Export data from the drop-down menu as shown below.

export power bi report to excel
export power bi to excel

Select the Summarized data and select the File format as .xlsx (Excel) from the drop-down. Click on Export.

Once you will click on the Export option, then the file will be downloaded and saved as per the name of the visualization.

export data from power bi visualizations
export power bi to excel

When you will open the Excel, then the spreadsheet will appear as the below screenshot. The Excel spreadsheet name will be the same as per the visualization name.

power bi export to excel with formatting
export power bi to excel

Underlying data details in Power BI Export

This Export underlying data details will work depends upon the help of your admin or IT department. In the Reporting view (In Power BI Desktop and Services), the measure option will display in the Field list with a calculator icon.

One most important thing you should know is, the Measures will create by using Power BI Desktop where the Power BI service does not.

In the below Table, It represents all the Visual Contains and what you will see in the Export in Power BI.

Visual Contains In Export, What you will see
Aggregates You will see the first aggregate and the data (non-hidden) from the entire table.
Aggregates You will see the related data. That means when the visual uses data from other tables which are related to the data table that contains the aggregate (where the relationship is *:1 or 1:1)
Measures You will see all measures that are present in the visual and all measures from any data table containing a measure that is used in the visual.
Measures You can see all non-hidden data from tables which contains the measure (where the relationship is *:1 or 1:1)
Measures It will help you to show all the data from all tables which are related to tables which contains the measure with the relationship of *:1 or 1:1
Measures only You will see all the non-hidden columns from all the related tables to expand the measure.
Measures only It will help you to summarize data for any duplicate rows for model measures.

Enable Export options in Power BI Desktop

To use the Power BI Export to Excel, you must ensure to enable the export option which is present in the Power BI Desktop.

To enable the Export to Excel option, Follow the below steps:

  • Go to the Power BI Desktop.
  • Select File (from the top left corner) -> Click on Options and Settings-> Select Options.
power bi enable export data
  • Select the Report settings which is present under the CURRENT FILE.

Once you will select the Report settings option, you can see three choices under the Export data section as shown below. The three choices are:

  • Allow end-users to export summarized data from the Power BI service or Power BI Report Server
  • Allow end-users to export both summarized and underlying data from the service or Report Server
  • Don’t allow end-users to export any data from the service or Report Server

To do the Power BI Export to Excel, you need to enable the first choice as you can see in the below screenshot. Once all things are done, just click on OK.

power bi export underlying data

Power BI Export to Excel Limitations

One of the most important things is the Limitations and considerations in Power BI Export to Excel. You should know about each and every limitation which is applied to Power BI Desktop, Power BI Service and Power BI Pro and Premium.

The Power BI Export to Excel limitations are presented below:

  • The first thing you need to know is the Power BI permission. To do the Export to Excel in Power BI, you have to build a permission for the underlying dataset.
  • Your application should have a maximum 150,000 number of rows which will export from an import mode report to an Excel file (.xlsx file).
  • Your application (In Power BI Desktop and Power BI Service) should have a maximum 30,000 number of rows which will export from an import mode report to an Excel file (.csv file).
  • In the Power BI Visualization, When you will enable the Show items with no data option, then the Underlying data will not work during Exporting.
  • Also, For the below reasons, Underlying data of Power BI Export will not work as:
  1. If the data source is an Analysis Services Live connection.
  2. If the version is older than in 2016.
  3. If the tables in the model don’t have a unique key.
  4. If an administrator or report designer has disabled this feature.
  • 16 MB is the maximum amount of data that Power BI can export when using the DirectQuery.
  • In Power BI, the Custom Visuals and R visuals are not supporting currently.
  • In Power BI Export to Excel, the Excel spreadsheet name should be the same as the Visualization name.
  • If your .csv file contains Unicode character, then the text in Excel will not display properly. In that case, try to open the file in a Notepad and there you can see the Unicode will display correctly. When you want to open the file in Excel, just import the file into .csv.
  • To import the file into Excel, follow these below things:
  1. Open Excel.
  2. Go to the Data tab.
  3. Select Get external data > From text
  4. Go to the local folder where the file is stored and select the .csv.
  • If you are the Admin in Power BI, then you can disable the export to Excel of data option.

You may like the below Microsoft Power BI tutorials:

  • Power BI Data Analysis Expressions (DAX) Tutorial
  • Power BI Query Group Tutorial
  • Power BI Change Data Type of a Column
  • How to Split Columns in Power BI
  • Power BI Buttons
  • Enter Data into Power BI Desktop
  • Power BI Workbooks
  • Power BI Error: This content isn’t available
  • Power BI On-premises Data Gateway
  • How to share Power BI Dashboard and Report
  • Microsoft Power BI Error: This content isn’t available
  • Power BI Custom Visuals

Hence in this Microsoft Power BI Tutorial, We discussed What are the different approaches to Export the Data, how to export the data from Power BI Desktop, Export the data from the Power BI Dashboard, Export the data from the Power BI Report.

Also, We saw Power BI Export underlying data details, how to enable the Export option in Power BI Desktop and what are the limitations and considerations in Power BI Export to Excel.

Bhawana Rathore

Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”

Like this post? Please share to your friends:
  • Exporting mysql to excel php
  • Exporting json to excel
  • Export excel to google docs
  • Exporting jqgrid to excel
  • Export excel microsoft sql