Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 18 SEP 2001 03:38:38PM Mike Parrish wrote:

Greets all!

I'm coding an OIPI report in which I need a table consisting of 2 columns and 1 row. Col1 is the header, Col2 is the data read from a database record. I'd like Col1 to be Arial 10 Bold and Col2 Arial 12 Regular. There should be a box around the entire table. My fonts are defined as "SMFONTBLD" for Arial 10 bold, and LGFONT for Arial 12 reg. In other words, the table should appear:


col1bold COLUMN 2 LARGER BUT NOT BOLD DATA TEXT

where Col1=1.5" and Col2=5"

Here are the lines of code that I've been fiddling with:

* Column 1 header

x=set_printer( "ADDTABLE", "^2160" , "Long description" , "", "", "", "", TB_BOX)

* Column 2 data appended

x =set_printer( "ADDTABLE", "^2160" : @VM : ", "", "", 1, TB_ALL)

Mind you, I've been fiddling with the 2nd line trying to get it to correctly append to the table defined for Col 1, but can't quite manage it. As it stands, these lines of code produce:


Long description

LONG DESCRIPTION READ FROM THE DATA RECORD

Almost, but not quite what I'm going for.

Should the 2nd column be defined in the first ADDTABLE? I'd assumed that if I was appending something, that cell definition would be in the line of code containing the append parameter.

I have a number of tables to add that will be similar, so any guidance would be appreciated.

Mike


At 18 SEP 2001 05:53PM Matt Crozier wrote:

Mike,

Appending to a table only works downwards. You do need to use two seperate ADDTABLES if you want different fonts between columns, but you also need to do the horizontal lines yourself as you need to calculate which cell takes the most vertical space (col2, I guess).

Try something similar along these lines. This assumes you set the default units to twips instead of inches in your INIT call…

posX=0

label=Long Description"

data=PREC

posY=get_printer( 'POS')

stat=set_printer( 'FONT', SMFONTBLD)

stat=set_printer( "ADDTABLE", "^2160" , "" , label, "", "", "", TB_COLUMNS)

col1Y=get_printer( 'POS')

stat=set_printer( 'FONT', LGFONT)

stat=set_printer( 'POS', @fm: posY)

stat=set_printer( "ADDTABLE", "

posY=if col1Y ] col2Y then col1Y else col2Y

stat=set_printer( 'LINE', posX: @fm: posY: @fm: posX + 9360: @fm: posY)

Hope that helps,

M@

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/83b1b960b113798d85256acb006be83b.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1