Details about columns

Details about columns

In Sptpl 2.0 was added the columns support. This feature mafe easy to build table, and aligned text.

The columns are grouped into columnset. The report may contains many columnset, but each time you must select one of them. The tags row, block allow you to select which columnset use, and within the columnset, which row use to place the text.

Each column has its own attribute such as width, margins, alignment, font (see the tag column). Some of those attributes (font, alignment) are the default setting for the text place inside the column. Those setting may be override by the row's own settings.

You may create the report without the columnset, if you don't plan to use the columns. The whole page is defined as column 0 by default from the PageManager even if you don't declare any columnset. On the contrary, when you create a new columnset, the PageManager add the column 0 to each columnset created.

Declare a new columnset

Before use the refence to a column, you must declare a new columnset as child of report.

<report>
  <beginreport>
   Hi

   My First Test
  </beginreport>
  <OpenPage>
Column test 1
  </OpenPage>
  <row id='pippo'>
Some text without set the column
  </row>

  <!-- set a new columnset -->
  <columnset id='test1'>
   <column  leftpos='5' Width='20' align='center' />
   <column  leftpos='26' Width='20' align='right' />
   <column  leftpos='47' Width='20' align='left' />
  </columnset>

Use the new columnset

Now we have our columnset, apply it.

By default no columnset is selected even the raport has only one columnset. In this case exist only the column 0 (the page). So I need to select my new columnset, and write my text into column 1.


  <row columnset='test1' column='1'>Text on the first column
  </row>

Now we have activated the columnset, we may use every column inside it.


  <row column='2'>Text on the second column
  </row>

  <row column='3'>Text on the third column
  </row>

Here the complete example.

Limits

You can't apply the columns to the openpage and closepage tags. They ignore it.