Click here to Skip to main content
15,887,386 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have developed a responsive intranet web application which is compatible with desktop, samsung galaxy tablet and iPAD. And the application is accessible only via GOOD for enterprise browser in Android and iOS since its an intranet application. I have an option to export data to excel in reporting module. Its working well in desktop not in android & iOS using good browser. Could anyone suggest any idea how export to excel option works in Android & iOS devices? Any little help would be much appreciated!!!

Thanks,
venk@
Posted
Comments
Ziee-M 22-May-14 4:43am    
hi, i am not a android nor iOS developper, but i guess it have somthing to do with file extension. is your Android, iOS have a programme that allows you to read excel file?
Whats happens when you try to export a file in those OS? error, exception...
venkatesun 22-May-14 9:12am    
I am giving .xls file format and the device has quick office installed!! When I click on "Export" button its showing the downloading in progress bar and shuttingdown itself without completing it.
[no name] 22-May-14 7:54am    
What library\API are you using to export to excel?
venkatesun 22-May-14 9:16am    
This is the piece of code I had written inside the "Export" button click event whick works well in Desktop.

GridView gv = new GridView();
List<reportmodel> listOfReports = new List<reportmodel>();

listOfReports = UML.getReports(TempData["fromDate"].ToString(), TempData["toDate"].ToString(), user.role);

var reports = listOfReports.Select(x => new { input,output }).ToList();
gv.DataSource = reports;
gv.DataBind();
Response.ClearContent();
Response.Buffer = true;
Response.BufferOutput = true;
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("content-disposition", "attachment; filename=Reports.xls");
Response.ContentType = "application/ms-excel";
Response.Charset = "";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gv.RenderControl(htw);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();
// return Redirect();
return RedirectToAction("Reports");
venkatesun 22-May-14 9:18am    
And I have tried various content type "application/ms-excel","application/octet-stream". no luck :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900