}
if (parameters.getParameterCount() > 3)
{
throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
}
final TypeRegistry typeRegistry = context.getTypeRegistry();
final String urlText = typeRegistry.convertToText(parameters.getType(0), parameters.getValue(0));
if (urlText == null)
{
throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
}
String tabText = null;
if (parameters.getParameterCount() > 1)
{
tabText = typeRegistry.convertToText(parameters.getType(1), parameters.getValue(1));
}
final ReportFormulaContext rfc = (ReportFormulaContext) context;
if (StringUtils.isEmpty(tabText))
{
final DocumentMetaData documentMetaData = rfc.getProcessingContext().getDocumentMetaData();
tabText = (String) documentMetaData.getBundleAttribute
(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE);
if (StringUtils.isEmpty(tabText))
{
final Object o = rfc.getDataRow().get("report.name");
if (o != null)
{
tabText = String.valueOf(o);
}
}
if (StringUtils.isEmpty(tabText))
{
final ResourceBundle bundle = ResourceBundle.getBundle
("org.pentaho.reporting.engine.classic.extensions.drilldown.messages");
tabText = bundle.getString("UnnamedTab");
}
}
final boolean tabActive;
if (parameters.getParameterCount() == 3)
{
if (Boolean.FALSE.equals(typeRegistry.convertToLogical(parameters.getType(2), parameters.getValue(2))))
{
tabActive = false;
}
else
{