Printing table output with WSPrint.
In this example, we will print output in a table format using wsprint. The process is as follows.
The script is shown below.
System.LoadFile('wsprint.js');
function printAlignTest() {
var a, b;
try {
a = new Printer('Microsoft XPS Document Writer');
var iTOP = 20;
var iBOTTOM = 20;
var iLEFT = 20;
var iRIGHT = 20;
var pMargin = [iTOP, iBOTTOM, iLEFT, iRIGHT];
var aFont={type:"Times New Roman", size:15};
a.print({font:aFont, margin:pMargin });
var row1= ['One','two','three'];
var row2=['four','five','six'];
var tablerows=[row1,row2];
a.tablePrint(tablerows);
}
catch(err){
System.TraceOutput(err);
}
}
printAlignTest();