This blog post explores a 4D Write Pro-related functionality which will help you with the creation of complex documents, programmatically. Documents that can be either printed or sent by email.
An expression can now be a Picture! Handling pictures in your 4D Write Pro documents is becoming easier, offering vast possibilities. From now on, any expression returning a picture can be inserted. The most obvious cases are fields and variables, but it goes also for 4D functions and, last but not least, your own methods!
An example is worth a thousand words
In this first example, vPicture is a picture variable.
ST INSERT EXPRESSION(*;"WParea";"vPicture";ST Start highlight;ST End highlight)
In this second example, [DOC]SamplePict is a picture field.
ST INSERT EXPRESSION(*;"WParea";"[DOC]SamplePict";ST Start highlight;ST End highlight)
In this third example, ComputeBarChart is a 4D method. This method generates and returns a bar chart picture.
ST INSERT EXPRESSION(*;"WParea";"ComputeBarChart";ST Start highlight;ST End highlight)
For more details, please refer to the ST INSERT EXPRESSION documentation. Please note that before using a 4D method in an expression, you first need to allow the usage of this method using the SET ALLOWED METHODS command.