Skip to main content

Using advanced table design in Lasernet - Knowledgebase / Lasernet / Lasernet General Information - Formpipe Support Portal

Using advanced table design in Lasernet

Authors list

Lasernet provides built-in tools in order to create tables. How to use these tools is detailed in the standard manuals that are installed with the product such as the Form Editor manual.

Lasernet version 9 or higher

The following content is relevant to version 9 or above.

Applying alternating row shading

Row shading can be applied to a pre-existing table by performing the following steps:

1. Select the pattern and set it to Odd/Even under the Alternating tab.

2. Open the Table Properties, and click the Body tab 

3. Select the Odd and Even colours needed for each row, click the Apply to all columns button and the Apply to all pages button to apply to all columns and all pages.



Below is the result:

Lasernet version 7 or higher

The following content is relevant to version 7 or above.

Applying alternating row shading via scripts

The image below is a table designed in Lasernet using a shading row script


This will use shapes, regions and scripts.

1. Add the following function to a script:


CODE 
{ logger.logEvent(5000, "obj = " + obj); logger.logEvent(5000, "fillColour = " + fillColour); logger.logEvent(5000, "lineColour = " + lineColour); logger.logEvent(5000, "Current Line = " + Line); if (Line % 2 === 0) { logger.logEvent(5000, "**EVEN ROW IDENTIFIED**"); logger.logEvent(5000, "Applying row shading: "); obj[Line].backgroundColor = "0x" + fillColour; if (lineColour != "") { obj[Line].color = "0x" + lineColour; } } else { logger.logEvent(5000, "**ODD ROW IDENTIFIED**"); } }


2. Create a Region in which the table data will output and then create a pattern to capture the data to be displayed in a table.

3. Configure the pattern to output in the newly created region and arrange the data on the output pane so that the columns are in the required order and the text aligned as desired.

Edit the properties

Use the Shapes tool to create a rectangle. 

1. Instead of drawing the rectangle on the output pane, click one of the lines of the pattern on the input pane. A rectangle should be created for each line in the pattern.

2. Edit the properties of the rectangle and go to the Output tab.

3. Adjust the size and position so that the rectangles line up exactly with each row and extend the full width of the table. The height of a line is usually 5mm.

4. Change the ‘Fill Color’ to the colour for the odd rows (i.e. 1,3,5,7 etc) to appear.

5. Change the ‘Line Color’ to the colour required for the table to appear.

6. At the top of the window set the Object Name (for example, “table1”) and click Ok.

The rows of the table are now shaded in the same colour.

7. Edit the properties of the rectangle and click the Input tab.

8. Select the Script > Active box so that a script can be run against this object.

The Script box

1. In the script box, call the script applyRowShading().

The script accepts parameters for ‘Object Name’, ‘Fill Colour’ and ‘Line Colour’

Object Name:  the name of the rectangle that was set earlier, in this case “table1”.

Fill Colour:  must be a hexadecimal representation of the colour to use as the background for even rows (2,4,6,8 etc). For example “FEF6FA”.

Line Colour:  must be a hexadecimal representation of the colour selected as the line colour for rectangles earlier. For example “FFFFFF”.

In this example we would write, in the script box, applyRowShading(table1,”FEF6FA”,”FFFFFF”);

2. Click Ok.

3. Now run the scripts on the page. The rows should alternate in colour.


Ensuring the header values remain on every page

Tables can be applied to a Conditional Area or a Region. The advantage of using a region is that the table title can stay at the top of the table without being affected by other content on either side of it.

In this example, we will apply a header to a table that spans multiple pages. We first need to create a region:

1. Right-click the Output area, select Conditional Area from the list and under the Regions tab, click Add.

2. Create a region and ensure the pattern is set to output to the region.


2. Click the Table option in the left toolbar and select Apply to Region.


This table has a header at the start but so far no header on the next page.




4. Double-click a title to display the Edit Rearrange window and select the Position tab.

5. In the Relative section, set the following from two of the drop-down options:

Relative to: Top of region

Region: The region you had created previously

6.  Select the All pages checkbox.

The title will now be set at the top of each page for that region:


This can be completed by doing the same to the other titles and by adding some shapes to add the table box. The shapes will need the same position settings as the previous step.


 

Adding a new column via the table tool

In this example, some new data has been added that needs to be included in the table.

1. Hover over the column line, right-click and select Insert Column.


2. Drag the column across to cover the new data.

Now the table has an extra column:

 

Merging columns via the table tool

To use the Merge Column option to merge two columns together, right-click the shared edge between two columns and click Merge Columns.


Adjusting the column dividing line via the table tool

With the table set up, the column dividers can be adjusted to match the data by clicking on the line and moving it.


The colour/width of each column line can be adjusted.  To do this, follow these steps:

1. Right-click the table to display the Table Properties window and select the Body tab.

Column 1 of 4 is displayed in the example below. 

To choose the required column, select either the Previous Column or the Next Column buttons.

The settings can be applied to all columns by using the Apply to all columns button.

2. Select the required width by entering a value in the Width field.



3. Use the Fill section to determine the line colours of borders and then click Ok.



Helpful Unhelpful

1 of 2 people found this page helpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?

Share