Report Layout Editor     


Scripting can be used in the Report Layout Editor to control many printing options such as printing fields under certain data conditions, etc.  There are two main elements in the Report that controls the script.

 

When is the action to take place

What action is to take place

 

To demonstrate this go into File>Reporting Configuration>Report and View Developer and click the ‘Add’ button.    Copy the ‘Item Detail Sheet’ to your Company Reports folder.  Select the copied report and click on the ‘Master Settings’ tab then on the ‘Edit’ button.  On the report layout scroll down to the ‘Child4’ Band.  You will see a small red triangle (?) in the band.  This denotes that it has some code linked to it.  If you click on the Band then we will address this linked code as follows

 

When is the action to take place:  If you click on the ‘Events’ tab to the left of the screen you will see that the ‘when’ is ‘OnBeforePrint’ and it relates to a script procedure in the adjacent field. (In this instance Child4OnBeforePrint.)

 

What action is to take place:  If you double-click on the Child4OnBeforePrint.it will take you to the ‘Code’ tab and position you at the Child4OnBeforePrint. Procedure.  You will see that script provides a visible = True or False depending upon the content of the Notes field