I assume you mean omitting, and not deleting ?
Correct.
btw: I like your elegant solution for naming the headers in an array.
However if you want to keep this code global(=re-usable for other queries)
you’ll have to re write the headerArray for each different query.
Thanks!
I ended up tacking on an extra argument to pass in the Array of headers, but aliasing the columnnames is a great option as well!
*One thing that is still a problem
lots of queries use double quotation marks, and this terminates the javascript call early.
I modified it to use ticks
to encompass javascript:globals.htmlCreator()
It renders fine in IE, but in Servoy’s htmlarea I get this as the text of the href:
and v.vendor_id=s.vendor_id and ac.account_id=s.account_id and ac.account_name like "%anderson%";','total','asc','HTMLReport','false')`>Total
heres a subsection of the generated html:
<html><body><a href=`javascript:globals.htmlCreator(500,'select order_id, date_onclip, part_no, ac.account_name, description, v.vendor_name, price, qty, qty * price total from sop_tmp s, vendors v, accounts ac where 1=1 and v.vendor_id=s.vendor_id and ac.account_id=s.account_id and ac.account_name like "%anderson%";','total','asc','HTMLReport','false')`>Total</a></body></html>
and heres the modified header code of globals.htmlCreator():
//create headers
HTML += '<TR class="header" >';
for(var i=1 ; i <= dataset.getMaxColumnIndex() ; i++)
{
var columnName = dataset.getColumnName(i)
HTML += '<TD border=0><a href=`javascript:globals.htmlCreator('+maxRows+',\''+query+'\',\''+columnName+'\',\''+sortDirection+'\',\''+htmlGlobalName+'\',\'false\')`>'+headerArray[i]+'</a></TD>';
}
HTML += '</TR>';
[/quote]