Nokia Lumia 920 Excel not open

0 votes

I created a responsive website in Asp.net using C#, and it functions flawlessly on both desktop and mobile devices. However, when I download Excel for the Nokia Lumia 920, it is downloaded but does not open on the phone. It displays errors such as Incorrect format.

I have used the below-mentioned code for downloading Excel :

Response.AddHeader("content-disposition", "attachment;filename=" + ExcelFileName + ".xlsx");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
StringBuilder build = new StringBuilder();
//buid contain data
Response.Output.Write(build.ToString());
Response.Flush();
Response.End();

What can be the solution?

Sep 26, 2022 in Others by Kithuzzz
• 38,000 points
471 views

1 answer to this question.

0 votes
The issue is with your code, not the phone, which is in perfect working order. Since you are delivering HTML and the response's response headers are set to xlsx, the format is actually improper and not what the phone expects. On desktop, this only functions because desktop Excel is able to display HTML tables as excel sheets, however AFAIK, Excel 2007, and newer versions notify the user that the data is in the wrong format.

The only solution is to create a real Excel file using an excel library. Use EPPlus as an example; it's straightforward and suitable for servers.
answered Sep 27, 2022 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

How to open .xlsx files in MS Excel from VS Code?

Hello, to open xlxs files, or files ...READ MORE

answered Feb 17, 2022 in Others by gaurav
• 23,260 points
4,144 views
0 votes
1 answer

Excel VBA if file closed, then open and paste, else just paste data

Slightly re-worked to add full workbook/sheet qualifiers ...READ MORE

answered Sep 21, 2022 in Others by narikkadan
• 63,600 points
1,047 views
0 votes
1 answer

JavaScript API does not work for Excel 2013?

Each method in the Office.js APIs is ...READ MORE

answered Sep 26, 2022 in Others by narikkadan
• 63,600 points
764 views
0 votes
0 answers

Creating an Instagram bot with reading an excel file and posing on Instagram, but some of words can not be read properly

from instabot import Bot import openpyxl import smtplib bot = ...READ MORE

Sep 26, 2022 in Others by Kithuzzz
• 38,000 points
804 views
0 votes
1 answer

Authenticate on an ASP.Net Forms Authorization website from a console app

Essentially, we need to record a regular ...READ MORE

answered Sep 20, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
911 views
0 votes
1 answer

Writing SEO friendly url gets infinite loop asp.net

you should know that regex avoid cases ...READ MORE

answered Feb 11, 2022 in Others by narikkadan
• 63,600 points
803 views
0 votes
0 answers

How to get Bitcoin value for corresponding USD value in ASP.NET C#?

I want to get the Bitcoin value ...READ MORE

Mar 1, 2022 in Blockchain by Soham
• 9,710 points
813 views
0 votes
0 answers

The request was aborted: Could not create SSL/TLS secure channel

When I connect to an  HTTPS server ...READ MORE

May 1, 2022 in Other DevOps Questions by Kichu
• 19,040 points
1,987 views
0 votes
1 answer

Excel cannot open the file because the file format or file extension is not valid - PHP Maatwebsite

Try this: if (ob_get_length() == 0 ) { ...READ MORE

answered Dec 19, 2022 in Others by narikkadan
• 63,600 points
1,450 views
0 votes
1 answer

Blazor - ClosedXml - excel cannot open the file beacause the file format or extension is not valid

Changed the following code: function BlazorDownloadFile(filename, bytesBase64) { var ...READ MORE

answered Jan 20, 2023 in Others by narikkadan
• 63,600 points
1,414 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP