728x90
반응형

//*----------------------------------------------------------------
//* grid로부터 XML data를 리턴한다.
//* parameter : grid grid 객체
//*-----------------------------------------------------------------
function g_grGetXMLData(grid)
{
var ds = Object(grid.BindDataset);
if ( ds == null)
return "";
var cellcount = grid.GetCellCount('body");
var collist = array(cellcount);
for ( j=0; j < cellcount; j++) {
collist[j] = grid.GetCellProp('body", j, "colid");
if ( collist[j] == "") {
collist[j] = "COLUMN"+LPAD(j, "0", 2);
}
}

var buff = '<?xml version="1.0" encoding="euc-kr"?>\n' + '<Contents>\n';
var linedata = "";
for ( i = 0; i < ds.GetTotalRowCount(); i++) {
var linedata = "<record>";
for ( j = 0; j < cellcount; j++) {
linedata += "<"+collist[j] + ">"
+ grid.GetCellTest("body",i,j)
+ "</"+collist[j] + ">\n";
}

linedata += "</record>\n";
buff += linedata;
}
buff += "</Contents>";

return buff;
}












var nSIze = lenStr-nCount;
if ( nSize == 0 ) nSize = -1;
return rpad(left(strValue, nSize), "*", lenStr);
}

728x90
반응형

+ Recent posts