FCLT#57060 Export naar excel minder onnodige HTML-overhead

svn path=/Website/branches/v2019.1/; revision=41721
This commit is contained in:
Jos Groot Lipman
2019-03-21 11:23:43 +00:00
parent bf5a141290
commit 433e52ba5a
2 changed files with 38 additions and 28 deletions

View File

@@ -746,7 +746,7 @@ var transitParam = buildTransitParam(["deel", "groep", "categorie_key", "distric
function fnLocatie(oRs)
{
if (hasReadALGUSE || hasReadALGMAN)
if ((hasReadALGUSE || hasReadALGMAN) && outputmode == 0)
{
return "<span class='details' title='{2}' onclick='naarlocatie({0}, this)'>{1}</span>".format(oRs("alg_locatie_key").Value, safe.htmlattr(oRs("alg_locatie_omschrijving").Value), (fulldetails ? safe.htmlattr(L("lcl_estate_locatie_title")): L("ins_srtcontrole_m")));
}

View File

@@ -1180,36 +1180,43 @@ function __rsMakeTableHeader(oRs, oRsFlexData, anyMultiActions)
{
if ((isPrinting || showProperties || isExcel || !columns[i].combine) && !(isExcel && columns[i].hidden))
{
html += "<th";
if (columns[i].caption == p_autosortby)
if (isExcel)
{
html += " id='autosortbyme'";
html += "<th>";
}
var sort_class = "";
if (columns[i].datatype == "currency" ||
columns[i].datatype == "float" ||
columns[i].datatype == "number")
else
{
html += " style='text-align:right;'";
if (safe.curr(1.5).indexOf(",") == -1)
sort_class += " sortable_numeric";
else
sort_class += " sorttable_numericcomma";
html += "<th";
if (columns[i].caption == p_autosortby)
{
html += " id='autosortbyme'";
}
var sort_class = "";
if (columns[i].datatype == "currency" ||
columns[i].datatype == "float" ||
columns[i].datatype == "number")
{
html += " style='text-align:right;'";
if (safe.curr(1.5).indexOf(",") == -1)
sort_class += " sortable_numeric";
else
sort_class += " sorttable_numericcomma";
}
if (columns[i].align)
html += " style='text-align:" + columns[i].align + "'";
var theClass = sort_class
+ (columns[i].thClass ? " " + columns[i].thClass : "")
+ (columns[i].classList ? " " + columns[i].classList : "");
if (theClass != null && theClass != "")
html += " class='" + theClass + "' ";
if (inlineDetails)
html += " preSorttable='hideAllInlineDetails(\""+ID+"\")'";
var hidden = columns[i].hidden ? (" style='display:none'") : "";
var title = columns[i].title == null ? "" : (" title='" + safe.htmlattr(columns[i].title) + "'");
html += hidden + title + ">"
}
if (columns[i].align)
html += " style='text-align:" + columns[i].align + "'";
var theClass = sort_class
+ (columns[i].thClass ? " " + columns[i].thClass : "")
+ (columns[i].classList ? " " + columns[i].classList : "");
if (theClass != null && theClass != "")
html += " class='" + theClass + "' ";
if (inlineDetails)
html += " preSorttable='hideAllInlineDetails(\""+ID+"\")'";
var hidden = columns[i].hidden ? (" style='display:none'") : "";
var title = columns[i].title == null ? "" : (" title='" + safe.htmlattr(columns[i].title) + "'");
html += hidden + title + ">"
}
if (!(isExcel && columns[i].hidden))
{
@@ -1455,7 +1462,10 @@ function __rsMakeTableRow(oRs, oRsFlexData, cnt, anyMultiActions, noFlexResult)
// Opbouw cell
if ((isPrinting || showProperties || isExcel || !columns[i].combine) && !(isExcel && columns[i].hidden))
{
appender += "<td" + align + hidden + tooltip + columnClass + customSort + nowrap;
if (isExcel)
appender += "<td";
else
appender += "<td" + align + hidden + tooltip + columnClass + customSort + nowrap;
if (isExcel && val != null && val.length > 0 && val.match(/[0-9]/)
&& !inArray(columns[i].datatype, ["date", "currency", "datetime", "float", "number"]))
{