Please enable JavaScript to view this site.

Navigation: Using the Cobwebb Designer

Conditioning Output Data

Scroll Prev Top Next More

Conditional operations are a powerful part of the Cobwebb Designer. They allow you to alter the layout the spooled file depending on the contents of the spooled file itself. You may wish to condition your output data depending upon certain criteria, perhaps the page number or maybe a company number printed on your spooled file for example, select the Conditional icon or press 5. If you wish to condition on data within your spooled file then select that data from the input pane with your mouse. If you wish to condition upon page number or a variable or parameter then you will need to select a small blank part of your input pane so that you can then change the conditional type in the Properties box. The data selected from the input panel with show up in red. If you look at the Conditional tab of the Properties box then you will see the default of POSITION as the Comparison On type. To change this you just need to click on the arrow to the right of the box and select the type of comparison that you require. The default for the Comparison Type is Equal to. Again you may change this by clicking on the arrow to the right of the entry.  If you are comparing to a given text then you will need to key this into the Data entry on the Properties box. Once again click on the Description tab and enter a description for this condition. You will see that the default description will be the data that you selected from the input pane, please change this to something useful so that you will be able to easily find this condition if you need to change it via the Explorer View.

If you now look in the Explorer View you will see the Conditional element entry. You now want to perhaps select data from your spooled file or enter Static Text relating to this condition. Click off the Explorer View and select the spooled file data or enter the Static text as previously described, then click back into the Explorer View (Ctrl E) and you will see the entry underneath the Conditional element. Next you need to click on the Spooled file or Static text element and drag it into the Conditional element, just as if you were moving a document between folders. You will see that the Spooled file or Static text element is nested under the Conditional element. You may, in this same way, nest actual Conditional elements.  If you need to perform more than one test before adding text or spooled file data then select the first Conditional element, then the second. Once you have completed the second go to the explorer view and drag the second Conditional element into the first and so on. Once you have entered all your Conditional elements you may then drag the text or spooled file data into the last Conditional element.

It is important to remember that if you are nesting your Conditional elements then each subsequent condition will only be performed if the previous condition has been satisfied.  

Example 1

       Item test 1

         Item test 2

                 Item test 3

                         Spooled File data

In Example 1 all Item test conditions would have to be satisfied before the Spooled File data would be output. With later versions of the Cobwebb Server software it is possible to nest following conditions at any level required.

Example 2

       Item test 1

         Item test 2

                 Item test 3

                         Spooled File data

         Item test 4

                 Spooled File data 2

In Example 2 Item tests 1, 2 and 3 will be performed before outputting Spooled File data 1. Then with Item test 1 still being in force (but not Item tests 2 and 3), Item test 4 will be performed and if satisfied Spooled File data 2 will be output. It is therefore important, with later versions of the software (4.2.01 and above), that you drag and drop your conditional elements into the correct level.

Note: It is often useful to have the Explorer View along side the Input and Output panes. To do this please refer to the Useful tips topic.

You may also compare the contents of one variable with another, a variable with a parameter or a parameter with another by e.g.

Conditional Properties

See General Properties for details on the General tab.

Conditional Element Properties

This is comparing to see if the variable CUSNO is Equal to PARM1. The ? at the beginning of the Data string indicates either a Variable name or a Parameter.

Comparison

On

Displays the item that the comparison is based on. Choose from PAGE, POSITION or one of the six parameters or a predefined variable.

Type

Displays the type of conditional operation. Choose one from the list that matches the type of comparison that you wish to perform.

Data

The data that will be used in the conditional operation. You may also compare to the value of a Parameter or Variable by entering a ? followed by the Parameter or Variable name e.g. ?PARM1.

When comparing on PAGE you may either enter the actual page number here or use one of the following entries:

Data

Description

*START

The very first page of the spooled file.

*FIRST

The first page of a new document as determined by the Page Setup.

*LAST

The last page of a document as determined by the Page Setup.

*END

The very last page of the spooled file.

Position (Relative)

Column

The horizontal position of the element in the input document

Line

The vertical position of the element in the input document

Force Absolute

When checked, forces the element to be positioned absolutely in the input document. See Absolute and Relative positioning for further details.

Size

Width

The width of the element in the input document.

Break Loop

Forces the Loop that this conditional element resides in to end if the condition is met.