Hot answers tagged

11 votes

End user cannot open a .xls report exported from Salesforce

We experienced the same issue and found a workaround that works for us. Right click the excel file you downloaded, click on properties. On that screen hit the "unblock" button and then hit apply. You ...
user avatar
10 votes

End user cannot open a .xls report exported from Salesforce

Is KB3115322 (Security Update for Excel 2010) installed? If so, uninstalling this update worked for us. I notified Salesforce about the problem so that either Salesforce or Microsoft fixes the issue,...
user avatar
  • 101
9 votes

How to generate excel files with the multiple sheets in VisualForce

public with sharing class ExportToExcelMultipleSheets { public List<account> accountList{get;set;} public List<contact> contactList{get;set;} public String xlsHeader{ get{ ...
user avatar
8 votes
Accepted

End user cannot open a .xls report exported from Salesforce

I contacted Salesforce's Support team and they provided this article as a temporary fix. They also mentioned: "Our R&D team has investigated this matter and logged a New Issue for it to be ...
user avatar
6 votes
Accepted

How can we use VF page to download excel inside Lightning component without redirecting?

This solution is implemented using Aura framework. I have posted a similar solution using LWC as well. This is an interesting scenario. In past, I have used download.js to trigger file download from ...
user avatar
6 votes
Accepted

Is there a way to dynamically fill excel sheets from apex?

Here's a slightly (well...much) more complex way of generating an Excel document using Visualforce, but it's much easier to get a good looking result that's an actual xls file, including native Excel ...
user avatar
5 votes
Accepted

Export to excel file problem with displaying information

Try this, <apex:dataTable value="{!acc}" var="a"> <apex:column value="{!a.ID}"/> <apex:column value="{!a.Name}"/> <apex:column> <apex:...
user avatar
  • 2,219
5 votes
Accepted

Can an Apex Email Handler parse an attached Excel file?

Short Answer: No its not posssible to read Excel in Apex. Long Answer: Excel files(xls,xlsx etc) are not a text based file. They are binary files. Thus unlike CSV(text based) they cant be read line ...
user avatar
4 votes

Exporting Visualforce to Excel including RichText fields

Ok this is the working solution <apex:page controller="AccountReportConfiguratorController" contentType="application/vnd.ms-excel; charset=Windows-1252#Report.xls " ...
user avatar
  • 2,092
4 votes
Accepted

Export Visualforce page to Excel with rich text

Funny you should ask this - I just submitted a blog yesterday that deals with this. Unfortunately, the blog has not been approved for publishing yet. The short version of the blog is Format a ...
user avatar
4 votes
Accepted

partial formatting in excel cell using xml spreadsheet in salesforce

An excel cell row which have partial worlds in bold should look like this: <Cell> <Data ss:Type="String"> <Font html:Color="#000000" xmlns="http://www.w3.org/TR/REC-...
user avatar
  • 22.2k
4 votes
Accepted

Warning when opening Apex generated Excel .xls?

Excel is warning you that the internal structure of the file is not a real Excel Workbook format. The software is intelligent enough to recognize that it is something else (I presume you're rendering ...
user avatar
  • 434k
4 votes
Accepted

Excel download from API

You can use a data URI to download the file: action.setCallback(this, response => { let a = document.createElement('a'); a.href = 'data:application/vnd.ms-excel;base64,'+response....
user avatar
  • 434k
4 votes

Display VF page content into Excel File - doesn't display all contents in excel file

Setting the contentType property of a Visualforce page does not perform any conversion of the data. Your page is still rendered as HTML; the server simply claims it is an Excel sheet, which is not ...
user avatar
  • 87k
3 votes

Export Visualforce Page in Excel as .xlsx and not as a Web Page.

The content of the page must be tabular format to be displayed as excel file. You can make sure of that as follows Remove the sfdc html/style coponents <apex:page standardStylesheets="false" ...
user avatar
  • 2,243
3 votes
Accepted

Send email with excel attachment - Blob variable doesnot exist error

The Blob.valueof method requires a string to be passed into the object. You will first need to convert the Map to the string representation of the of the CSV data. I had ran into that issue once ...
user avatar
  • 743
3 votes
Accepted

Render page as excel, default output is without gridlines

When we download Excel using default code(Like your) we don't get much styling and also the gridlines are missing as well. To handle this you need to modify your code and need to create excel in ...
user avatar
3 votes

Importin Excel files in xls format

Unfortunately, it doesn't support xls files. Format: When you create the file of subscriber data to be imported into the application, save it as a tab-delimited .txt file or a comma-delimited ....
user avatar
3 votes

CSS for Excel Accounting Format?

You can place the currency symbol in the first column, and then you can display the currency value (without the currency symbol) in the second column. The last step would be to remove the border ...
user avatar
3 votes

Rebuild Excel Formula "Rate" in Apex

Here's the code I came up with, based on some examples in javascript I found online. I tested it for a number of different scenarios and was able to get the same results as in Excel. public class ...
user avatar
2 votes
Accepted

How to use TableTools plug-in for DataTables in Visualforce page?

I don't know if you fixed this this issue or not but the code below works, change your sSwfPath. Let me know I can help you with this, I already spent a lot of time using all the plugins from data ...
user avatar
  • 1,821
2 votes

How to use TableTools plug-in for DataTables in Visualforce page?

You need to assign the data table to an object and pass that into the TableTools initialization. I.E. var oTable = j$('table.dataTable').dataTable({ sPaginationType: "full_numbers" ...
user avatar
  • 53.1k
2 votes

Salesforce Excel Connector

Consider using the excellent tool - Enabler4Excel ? https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B3GBzEAN , It gives you a visual way to create and assess Salesforce queries. ...
user avatar
  • 53
2 votes

render as excel on browser it self without downloading

If you're just exporting tabular data in the excel file you can actually just return HTML with a different mimetype and put the content in an HTML table. You need a couple of page headers: Content-...
user avatar
  • 24.7k
2 votes

how to generate an excel sheet using apex code such that the excel sheet has proper table and data in order

You need to set an attachment content type, for your computer to open the file in Excel. You'll also want to use a CSV extension, since this isn't a true .xslx. Try the following section to replace ...
user avatar
2 votes

Visual Force as Excel: Multiple CSS classes not supported?

Salesforce is emitting the HTML you are instructing it to by the markup you include in your page. All that the contentType setting is doing is adding a header that your browser recognises and so ...
user avatar
  • 130k
2 votes

Visualforce export to Excel on mac

My understanding is that none of these solutions will generate a real XLS file. The best result we will get is an HTML file with a wrong extension (.xls), which MS Excel will read and then convert to ...
user avatar
  • 451
2 votes

Formating of Excel generated by VF page

I haven't tried it, but take a look at this. Instead of using HTML tags, it uses tags that are recognised by Excel. In terms of XML markup, I think that page is slightly wrong, this seems like a good ...
user avatar
  • 2,490
2 votes

Handling Empty Rows of Excel in Apex

You can easily do this. Remove all comma and check for size and if length == 0 then ignore the line. for(String line: lines) { if (line.replaceAll(',','').trim().length() == 0) break;
user avatar
2 votes

Export to Excel with Command Button

The options I can think of offhand: Conga Composer offers the ability to merge salesforce data into templates, which can be excel files. You can read more on their website. Linking to an existing ...
user avatar
  • 8,554

Only top scored, non community-wiki answers of a minimum length are eligible