Keep formatting when exporting XLSX file through ExcellentExport.js

0

Good morning,

I have a question about using ExcellentExport.js version 2.0.3

I can export my table without problems to download the xls file, however when I open it, the following message is displayed.

ByclickingYes,ExcelwillnormallyopeninPROTECTEDVIEWMODE.

Mycodeonthedownloadbutton:

<aclass="btn btn-primary btn-block" role="button" download="rastreabilidade_'.$ped_pro.'_'.date("d_m_Y_H_i_s").'.xls" href="#" onclick="return ExcellentExport.excel(this, \'rastreabilidade\', \'bartender\');">Gerar Rastreabilidade</a>

My question is, are there any ways to use ExcellentExport without it displaying this message? Or are all files coming from Download considered unsafe and tend to open this way in Excel?

For my problem I was able to solve using a newer version of ExcellentExport.js exporting the file in XLSX, with the following code:

<a class="btn btn-primary btn-block" role="button" download="somedata.xlsx" href="#" onclick="return ExcellentExport.convert({ anchor: this, filename: 'rastreabilidade_'.$ped_pro.'_'.date("d/m/Y_H:i:s").'', format: 'xlsx'},[{name: 'bartender', from: {table: 'rastreabilidade'}}]);">Gerar Rastreabilidade</a>

But in this way I lost the formatting (Eg, colspan, h1). Do you know how you could keep formatting?

    
asked by anonymous 30.07.2018 / 17:21

0 answers