Adding Custom Labels
We can add to this list by configuring custom labels displaying various data and properties.
-
Select the gear icon next to the Text dropdown. This opens the configuration dialog.
-
Press the blue plus icon to add a new label.
-
Rename the label as desired.
- Paste the sample formula into the code editor. Sample code can be found here.
Note, In this instance the LevelName "Blast" is being called and displayed. This level name is determined by the user setup in the Tables Setup task and the corresponding level names used. For instance, if I tried to return a level name called "Solid" a blank would be returned as my table level name used is "Blast".
Note, Additionally in this instance the ReserveValue "Volume" and "DryTonnes" are being called, converted to string format and displayed. The available reserves fields that can be called and displayed is determined by the user setup in the Reservable Model Generator task and the corresponding Field names used. For instance, if I tried to return a Field name called "dryT" a blank would be returned as my Field name used is "DryTonnes". - Press Ok to finish.
-
Select the newly added label from the Label: field dropdown. (Note that custom shadings are shown in bold orange, while standard shadings are shown in normal black).
-
To view the label, make sure you the Labels eye toggle is enabled.
Example of Multi Row label
Multi Row Custom Labels Example
See below an example of a muti row label you can copy and paste into your Code Editor, making some custom changes as required.
Multi-Line Label
using System;
using Alastri.RR.Ui;
using Alastri.RR.Service;
public class LabelFormat : ILabel
{
public string GetLabel(ShadingContext context)
{
return "Blast " + context.GetLevelName("Blast") + "\n"
+ context.GetReserveValue("Volume").ToString("#,##0") + " bcm \n"
+ context.GetReserveValue("DryTonnes").ToString("#,##0") + "t";
}
}
Want to learn more?
Click here to login to our Learning Management System
Click here to request access
Comments
0 comments
Please sign in to leave a comment.