Simple Example of Dropping a Table/Chart

micajblock
edited February 11, 2022 in Analytics #1
The trick is to name the charts and/or the tables. The code is fairly simple.
var oTable = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Offices");
var cTable = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Customers");
var pTable = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Products");


if (params["pTable"].value == "Customers") {
oTable.drop();
pTable.drop();
}
else if (params["pTable"].value == "Offices") {
pTable.drop();
cTable.drop();
}
else {
oTable.drop();
cTable.drop();
}