rowspan and printview

I have a grid that has rowspan,and when I execute printView() of the grid,it can not give the right view of the grid,so I have to rewrite the dhtmlxgrid_nxml.js,the main job is to rewrite the printview function,the new one as below,I hope the people can avoid this problem.the blues are added by me.

dhtmlXGridObject.prototype.printView = function(before, after) {
var html = "TD {font-family:Arial;font-size:13px;text-align:center;padding-left:2px;padding-right:2px};\n td.filter input, td.filter select {display:none};\n ";
var st_hr = null;
if (this._fake) {
st_hr = [].concat(this._hrrar);
for (var i = 0; i < this._fake._cCount; i++) this._hrrar[i] = null
};
html += “”;
if (!this.parentGrid) html += (before || “”);
html += ‘

’;
var row_length = Math.max(this.rowsBuffer.length, this.rowsCol.length);
var col_length = this._cCount;
var width = this._printWidth();
html += ‘’;
for (var i = 0; i < col_length; i++) {
if (this._hrrar && this._hrrar[i]) continue;
var hcell = this.hdr.rows[1].cells[this.hdr.rows[1]._childIndexes ? this.hdr.rows[1]._childIndexes[parseInt(i)] : i];
var colspan = (hcell.colSpan || 1);
var rowspan = (hcell.rowSpan || 1);
for (var j = 1; j < colspan; j++) width[i] += width[j];
html += ‘’;
i += colspan - 1
};
html += ‘’;
for (var i = 2; i < this.hdr.rows.length; i++) {
if (_isIE) {
html += “”;
var cells = this.hdr.rows[i].childNodes;
for (var j = 0; j < cells.length; j++) if (!this._hrrar || !this._hrrar[cells[j]._cellIndex]) {
html += cells[j].outerHTML
};
html += “”
} else html += “” + (this._fake ? this._fake.hdr.rows[i].innerHTML: “”) + this.hdr.rows[i].innerHTML + “”
};
var colInt = new Array(col_length);
var rowInt = 0;
for (var i = 0; i < row_length; i++) {
html += ‘’;
if (this.rowsCol[i] && this.rowsCol[i]._cntr) {
html += this.rowsCol[i].innerHTML.replace(/<img[^>]*>/gi, “”) + ‘’;
continue
};
if (this.rowsCol[i] && this.rowsCol[i].style.display == “none”) continue;
var row_id
if (this.rowsCol[i]) row_id = this.rowsCol[i].idd;
else if (this.rowsBuffer[i]) row_id = this.rowsBuffer[i].idd;
else continue;
    for (var j = 0; j < col_length; j++) {
        if (this._hrrar && this._hrrar[j]) continue;
        if (this.rowsAr[row_id] && this.rowsAr[row_id].tagName == "TR") {
            var c = this.cells(row_id, j);
            if (c._setState) var value = "";
            else if (c.getContent) value = c.getContent();
            else if (c.getImage || c.combo) var value = c.cell.innerHTML;
            else var value = c.getValue()
        } else var value = this._get_cell_value(this.rowsBuffer[i], j);
        
        var color = this.columnColor[j] ? 'background-color:' + this.columnColor[j] + ';': '';
        var align = this.cellAlign[j] ? 'text-align:' + this.cellAlign[j] + ';': '';
        var rspan = c.cell.getAttribute("rowspan");            
        var cspan = c.getAttribute("colspan");
        if(i>rowInt && colInt[j]==j){
        	html += '';
        }
        else            	html += '<td style="' + color + align + '" ' + (rspan>1 ? 'rowSpan="' + rspan + '"': '') + (cspan ? 'colSpan="' + cspan + '"': '') + '>' + (value === "" ? "&nbsp;": value) + '</td>';
        if (cspan){j += cspan - 1};
        
        if(rspan>1){
        	rowInt = i;
        	colInt[j] = j;
        }        
    };
    html += '</tr>';
    if (this.rowsCol[i] && this.rowsCol[i]._expanded) {
        var sub = this.cells4(this.rowsCol[i]._expanded.ctrl);
        if (sub.getSubGrid) html += '<tr><td colspan="' + col_length + '">' + sub.getSubGrid().printView() + '</td></tr>';
        else html += '<tr><td colspan="' + col_length + '">' + this.rowsCol[i]._expanded.innerHTML + '</td></tr>'
    }
};
if (this.ftr) for (var i = 1; i < this.ftr.childNodes[0].rows.length; i++) html += "<tr style='background-color:lightgrey'>" + ((this._fake && _isFF) ? this._fake.ftr.childNodes[0].rows[i].innerHTML: "") + this.ftr.childNodes[0].rows[i].innerHTML + "</tr>";
html += '</table>';
if (this.parentGrid) return html;
html += (after || "");
var d = window.open('', '_blank');
d.document.write(html);
d.document.write("<script>window.onerror=function(){return true}</script>");
d.document.close();
if (this._fake) {
    this._hrrar = st_hr
}

};

’ + this.getHeaderCol(i) + ‘