CFL has several functions that are not general purpose (as those above) but specific to layout of pages and signs on a roll or sheet. Though the calculation can be (and has been) done using the general formulas, these occur so often that CFL has special functions to manage them.
See Also cfl_function_-_calculatelayoutonroll and cfl_function_-_calculatelayoutonsheet.
In order to determine the optimal layout, Control must calculate the layout with both a portrait and landscape orientation. Each of these orientations is tiledTiling refers to putting multiple copies next to each other across the width. (to fill the width of the roll) or paneledPaneling refers to splitting a copy across multiple rolls. if the item width is larger than the roll width. The total amount of material used for the required number of copies is calculated and the orientation with the minimum material usage (that also satisfies other requirements passed in) is chosen.
This concept, though simple, involves complex calculations that formerly took over 30 independent variables to compute and record. Hence, this function has been well received!
I would recommend experimenting on a new product while you are learning and avoid changing anything on your existing products until you are satisfied with your results.
One common mistake is also to forget the distinction between GetVariablePropertyValue and GetVariablePropertyText. The former must be used to pull number and yes/no values, while the latter must be used to pull text values.
We are going to create a basic layout here. There are some additional options to this function we won't explore in this How-To, but the names of the parameters and documentation at cfl_function_-_calculatelayoutonrollshould be sufficient to help you refine it to your needs.
Create the following text variable to store the results of the calculation.
RollLayout (Used to store the results of the layout calculations.) Enter the following formula in the Default value formula.
Everything after the double-slashes is a comment. It isn't required but you'll thank yourself later if you record what you are doing today.
Although we aren't doing so in this simple example, you can use any valid CFL statement for each of these parameters. You don't have to create variables for each value that is passed in unless it makes sense to (usually because the user can override it).
Create the following calculated number variables and set the formulas as indicated. Set the units to the appropriate units for the variable.
Create the following text variable to provide information to display to the user.
- Set the price formula to charge a certain rate for printed area and a certain rate for the scrap.
- Create a product layout if desired.
- Create a pricing form that uses these variables (requires Control Customizable) and set the product to use this Pricing Form. Make sure the RollPrintLayoutNotes variable is displayed in a memo large enough to see the results as you work.
**Hint**: If you are just creating this for testing and don't want to bother with a polished Pricing form, or if you don't have Control Customizable, you can use the "Variable Grid" pricing form. This pricing form creates a grid of all of the variables in a product (arranged alphabetically) that you can use while you are testing and debugging.
A sample pricing form text is below (you can copy the text below and paste it into the "Advanced" tab in pricing form entry and then click the lightning button to generate it.
Add the product you created above to the order.
Enter different sizes. Confirm that the rotation, tiling, and paneling property all work as you expect.