function PrintDataColumn(prt) { this.headName = new Array(prt.head.count); this.headText = new Array(prt.head.count); this.detailName = new Array(prt.detail.count); this.detailText = new Array(); this.footName = new Array(prt.foot.count); this.footText = new Array(prt.foot.count); this.headCount = prt.head.count; this.columnCount = prt.detail.count; this.footCount = prt.foot.count; this.rowCount = 0; //Begin Constructor ---------------------------------------- if (prt.mode == "test") { this.rowCount = prt.testRowCount; } else { this.rowCount = prt.rowCount; } this.detailText = new Array(this.rowCount); for (var i = 0; i < this.rowCount; i++) { this.detailText[i] = new Array(this.columnCount); } for (var j = 0; j < this.columnCount; j++) { this.detailName[j] = prt.detail.columns[j].name; } for (var j = 0; j < this.footCount; j++) { this.footName[j] = prt.foot.columns[j].name; } for (var j = 0; j < this.headCount; j++) { this.headName[j] = prt.head.columns[j].name; } //END Constructor ---------------------------------------- this.indexOf = function (name) { for (var j = 0; j < this.columnCount; j++) { if (this.detailName[j] == name) { return j; } } return -1; } this.addData = function (row, name, text) { var colIndex = this.indexOf(name); this.detailText[row][colIndex] = text; } this.getData = function (row, name) { var colIndex = this.indexOf(name); return this.detailText[row][colIndex]; } this.indexOfFoot = function (name) { for (var j = 0; j < this.footCount; j++) { if (this.footName[j] == name) { return j; } } return -1; } this.addFootData = function (name, text) { var colIndex = this.indexOfFoot(name); this.footText[colIndex] = text; } this.getFootData = function (name) { var colIndex = this.indexOfFoot(name); return this.footText[colIndex]; } this.indexOfHead = function (name) { for (var j = 0; j < this.headCount; j++) { if (this.headName[j] == name) { return j; } } return -1; } this.addHeadData = function (name, text) { var colIndex = this.indexOfHead(name); this.headText[colIndex] = text; } this.getHeadData = function (name) { var colIndex = this.indexOfHead(name); return this.headText[colIndex]; } }