The PDF creator handles many of the standard reporting functions, most
notably is the handling of table structures, which is accomplished by use of a
ruler. A ruler is a list of values that define columns and how they should
treat the text within the cells. Text within a cell can be left, right,
center or period justified. Text that exceeds the cell width can be truncated,
truncated with 3 dots (...), or word wrapped. You may use as many rulers as
required to format the text. Text can be placed into the document without
a ruler, in this case the text will be word warped and paginated, and as text is
added it will be positioned to the end of the previous text allowing font
characteristics to be adjusted on a character by character basis.
Client Side - Using Header / Footer Callback Example:
Client Side - Using Ruler Example: A Ruler defines left, right margins and 0 or more tab
positions. This example sets 3 tab positions first tab 4" for the
part number, second tab at 5" right justified for Quantity, and the
third tab at 6" justified on the decimal place (Period) for the price.
<html><head><title>PDF Sample Ruler</title></head>
<script src="scripts/CollinsPdf.js" language="javascript"></script>
<script>
//===========================================================
// createPdf
//===========================================================
function createPdf()
{
pdf = new pdf$();
pdf.setRuler('1,4,R5,P6,7.5');
//---------- Column Headings ----------
<html><head><title>PDF Sample ADO Report</title></head>
<script src="scripts/CollinsPdf.js" language="javascript"></script>
<script>
//===========================================================
// createPdf
//===========================================================
function createPdf()
{
var i,line,cnn,rs;
pdf = new pdf$('DRAFT',onPageheader,onPagefooter,onPagebreak,false);
pdf.setRuler('R0.5,1.25W,4,5.3,6,8');
pdf.setRulerAlign('middle');
pdf.setBorderWidth(1);
onPagebreak();
//---------- Details ----------
line = 0
cnn = new ActiveXObject('ADODB.Connection');
cnn.open("provider= microsoft.jet.oledb.4.0; data source=pdf_sample.mdb");
rs = new ActiveXObject('ADODB.recordset');
rs.Open('select * from data order by st,city,sortname' ,cnn,2,3);
rs.MoveFirst();
values = new Array();