"It turned out to be reliable, fast and easy-to-use. Just what we needed!"

- Carine Pauly, Information Systems Co-Ordinator, AmCham EU

 

With Formulas you can tell CatBase how to decide what to publish and/or how to format it

The Formula Editor offers lots of options. You can tell CatBase to do certain things depending upon criteria that you specify:

The Formula Editor

To set up a new Formula, click on the Add an Element button in a Paragraph and choose the Formula radio button The Formula editor looks like this:

Formulas work on an "If-Then-Otherwise" construction: IF something is true, THEN do something, OTHERWISE do something different.

The IF Area

In this area you select the criteria that the decision will be based on:

IF area in formula

The options may change, depending on the type of field that's selected. For example, if you choose a "choice list" type field, the options available in that choice list will appear:

If it's a Boolean (Yes/No) field, your choices will be "True" or "False":

If Boolean

There are different options for date and numeric fields:

Choose one of the first/last record options if you want to publish something at the beginning or the end of a selection of data. For example, you might want to publish a comment at the beginning of the selection of records, or some text such as warranty information at the end of the selection. A selection of data could be the entire publication, or the section that you are publishing, or a group of related records such as parts or company contacts.

The THEN area

Once you've selected your IF decision criterion, you need to specify what to do if that evaluates to TRUE - eg if the field dos contain the specified text, or the date is after the specified date, etc.. That's what the THEN area is for:

You can choose from six different actions to take, and also choose whether you want to apply a different style to the Paragraph or the Element (if you are not sure what Paragraphs and Elements are, please see the Publishing Style Sheet Tutorial).

Export Field: Select this option to publish the data from a field, then choose the field from the popup menu next to the radio button.

Export Text: Choose this option to publish some static text, and then enter the text into the area next to the radio button. A typical use is to insert a comma and a space if the Address Line 2 is not blank.

Export Picture: Choose this option to publish a picture if your criterion is true. The picture can either be a specific, static picture or a picture from the individual records:

If you select Specific Picture, you must then click on the Select Picture button to choose the picture that you want to publish. In either case, you must then click on the Picture Setup button to choose the parameters for the picture - what size to draw the box, whether to give it a frame, etc. As an example, you might want to publish a special "New product" splash for any products that were added after a certain date.

Include this Paragraph: Choose this option if you simply want to tell CatBase to publish the data in the current Paragraph if the IF is true. You will then add additional Elements to the Paragraph for the data that you want to publish. When you select this option, the Don't include this Paragraph will be selected in the OTHERWISE area.

Export Punctuation: Choose this option to publish punctuation such as a Tab, Return, or Next Page character:

For example, you might want to publish a Tab only if the Fax Number field is not blank.

Run a script: We can write scripts to do all kinds of special tasks: perform calculations, manipulate data, send emails ... whatever you need to do, we can probably write a script to accomplish it! Please contact us if you would like to discuss your requirements.

Style: Choose this option if you want to select a different style for the entire Paragraph or just for this Element:

If you choose Style for Paragraph, the popup menu will show a list of Paragraph Styles to choose from. If you choose Style for Element, the popup menu will show a list of Character Styles to choose from.

The OTHERWISE Area

In this area you tell CatBase what to do if the IF part of the Formula evaluates to False:

The choices are much the same as in the THEN area, with Don't include this Paragraph instead of Include this Paragraph, and the addition of the Don't include this Column option. Don't include this Column is only relevant if the Paragraph has been set up to create a table.

The AND ALSO area

In this area there are additional options you can choose, which will be applied if the IF is True:

You could use this option, for example, to discount prices for sale items or to mark items up or discount them by a certain amount, which could be a static value or a value from the database. Here are a couple of examples:

Discount the price by 10%:

Multiply the price by an exchange rate factor from the related Manufacturer's record:

The Completed Formula

When you've et up your Formula, a summary of it is show at the top of the window - for example:

What's Next?

About Us | Site Map | Privacy Policy | Contact Us | ©2009 CatBase Software Ltd.