on 2017 Oct 02 5:20 PM
I have this code in sapui5 part js:
onExcel: function(oEvent) { //table
this.capturar_vistal();
var tmpElemento = document.createElement("a");
var data_type = "data:application/vnd.ms-excel";
var tabla_div = document.getElementById(idTable).innerHTML;
var tabla_html = tabla_div.replace(/ /g, "%20");
tmpElemento.href = data_type + ", " + tabla_html; //Asignamos el nombre a nuestro EXCEL tmpElemento.download = "tabla.xls";
tmpElemento.click(); },
capturar_vista: function() {
var vista = sap.ui.getCore().byId($(".vista0")[0].id + "--innerApp");
/*Capturamos la url para saber en que vista nos encontramos*/
var URLactual = window.location; str = "";
if (URLactual.hash.indexOf("/") !== -1) {
str = URLactual.hash.substr(URLactual.hash.indexOf("/") + 1, URLactual.hash.lenght);
}
if (str === "" || str === "undefined") {
str = "expediente";
} /*Definimos una variable con la tabla de la vista en la que nos encontramos */
for (i = 0; i < vista.mAggregations.pages.length; i++) {
if (vista.mAggregations.pages[i].mProperties.viewName == "preparacion_cdci.view." + str) {
tabla = vista.mAggregations.pages[i].mAggregations.content[1].mAggregations.content[0]; idTable = tabla.sId; } } },
with this code I can download as an excel but it daesn't take the css & the utf8
What I need to do?
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.