Example—Using the properties and method of the Placement node.
To move an object (graphic) across a dashboard frame:
In Interactive Reporting Studio, select File, then New
New File is displayed.
Select Other, then A Blank Document, and then click OK.
The document opens in Design mode.
From Elements, expand Graphics, drag the rectangle onto the dashboard and resize it to be bigger.
Right-click the rectangle, and select Properties.
Properties is displayed.
In Properties, enter a Name for the rectangle, and click OK.
For example, type Field. The rectangular shape is the area that the ball graphic moves across.
Optional: Select Border and Background, and change the background color.
From Graphics, drag a picture onto the dashboard, and then navigate to and select an image of a ball.
In Properties, enter a Name for the graphic, and click OK.
For example, type Ball.
From Elements, expand Controls, and drag an option button onto the dashboard.
With the option button selected, drag a copy to the right to create a duplicate.
In Properties, enter a Name, Title, and Group Name, and then click OK.
For example, type Left as the Name, Move Left 100 as the Title, and LeftRight as the Group Name.
Repeat step 12 for the second option button with alternate data.
For example, type Right as the Name, Move Right 100 as the Title, and LeftRight as the Group Name.
From Controls, drag a command button onto the dashboard, right-click, and select Properties.
In Properties, enter a Title, and click OK.
For example, type Move Ball.
Right-click Move Ball again, and select Scripts.
Script Editor is displayed.
Copy and paste this script into the editor. You can modify the script to suit your requirements.
var moveHoriz if (Right.Checked){ moveHoriz = 100 }else{ moveHoriz = (-100) } var left = Ball.Placement.XOffset var top = Ball.Placement.YOffset var width = Ball.Placement.Width var height = Ball.Placement.Height if (moveHoriz > 0){ if ( left+width+moveHoriz > Field.Placement.XOffset + Field.Placement.Width){ Alert ("Reached the right end of the field","Goal !!! Yay!!!") Ball.Placement.XOffset = Field.Placement.XOffset + Field.Placement.Width - Ball.Placement.Width Left.Checked = true return } }else{ if ( left+moveHoriz < Field.Placement.XOffset){ Alert ("Reached the left end of the field","Goal !!! Yay!!!") Ball.Placement.XOffset = Field.Placement.XOffset Right.Checked = true return } } Ball.Placement.Modify(left + moveHoriz, top, width, height)