1
I’m using the vue-json-excel to export an Excel spreadsheet (I have the table on my screen and use it to export the same data to excel).
Until then, everything works perfectly, however, I had problems with accents. Example, the não, appears Não, and so on.
<download-excel
class = "btn btn-default"
:data = "data.resultado"
:fields = "json_fields"
:meta = "json_meta"
name = "filename.xls" style="margin-bottom: 10px;">
</download-excel>
JS
data(){
return{
data: {},
filterTerm: '',
json_fields : {},
json_data: [],
json_meta: [
[{
"key": "charset",
"value": "utf8"
}]
]
}
},
The data is coming from the database, and on the screen, are displayed correctly.
That way, I do to insert the data from my database into one objeto
for(let i = 0; i < this.data.titulos.length; i++){
this.json_fields[this.data.titulos[i]] = "String"
}
JSON RETURN
{
"titulos":[
"Data Emissão",
"Data Saída",
"CAMPO 3",
"CAMPO 4"
],
"resultado":[
[
"Carta Correção",
"Não",
"Não ",
"09/08/2017 17:56"
],
[
"Solicita Alteração",
"Não",
"Não ",
"09/08/2017 17:56"
],
[
"UM",
464752,
"UM ",
"09/08/2017 17:56"
],
[
"UM",
464752,
"UM ",
"09/08/2017 17:56"
]
]
}
I had tested, tested every way, then opened the file of
node_modules/...and compared it to the file ongithubof them, and saw that he was not receiving thepropmeta. Ai managed to solve the way up. But thanks Sergio, Oce always helps me ;)– Rafael Augusto
@Rafaelaugusto I used your integral code, I just added the
-inutf8:)– Sergio
@Rafaelaugusto finally sent a suggestion :) https://github.com/jecovier/vue-json-excel/pull/10
– Sergio
can you tell me why
errowhen I try to export a table with lots of data? if I do with few, normal low, if minejsonhas a lot of data, is downloading (but never low, nor starts or shows in the downloads, but if you try to close the browser, says that has a download in progress).– Rafael Augusto
@Rafaelaugusto I have no idea. Maybe there is some character in the data that makes the program stop.
– Sergio
Strange because it is only with good amount of record, but I will give a analyzed, then back to leave feedback. Hugs
– Rafael Augusto