To programmatically create a shape on a dashboard, use CreateShape(bqShapeType, [sectionName]). The first parameter specifies the sort of shape or control to be created and must be one of the values of the bqShapeType enumeration.
If the shape being created is an embedded section, the section parameter must be the name of the section to be embedded. This must be a chart, pivot, result set, or table. If the name of any other section type is supplied the function fails and an exception is thrown.
When creating shapes using COM, you must supply a value for the second parameter. You can supply the empty string “” for this value for shapes and controls other than embedded sections.
Shapes are created at the top-left of the dashboard section, with a default size based on type of shape or control. The default size is the size used when the shape is dragged onto the dashboard in Design mode.
A reference to the newly created shape is returned from this function. You can use the reference to set the Placement of the shape using the Placement properties or functions, see Placement Node, and you can set the name of the shape using the Name property.
Note: | Using more than 1,021 shapes is not supported in a Dashboard section. |