protected function renderReport($apiAction, $controllerAction = false)
    {
        if (empty($controllerAction) && is_string($apiAction)) {
            $report = ReportsProvider::factory($this->pluginName, $apiAction);

            if (!empty($report)) {
                $apiAction = $report;
            }
        }

        if ($apiAction instanceof Report) {
            $this->checkSitePermission();
            $apiAction->checkIsEnabled();

            return $apiAction->render();
        }

        $pluginName = $this->pluginName;

        /** @var Proxy $apiProxy */
        $apiProxy = Proxy::getInstance();

        if (!$apiProxy->isExistingApiAction($pluginName, $apiAction)) {
            throw new \Exception("Invalid action name '$apiAction' for '$pluginName' plugin.");
        }

        $apiAction = $apiProxy->buildApiActionName($pluginName, $apiAction);

        if ($controllerAction !== false) {
            $controllerAction = $pluginName . '.' . $controllerAction;
        }

        $view      = ViewDataTableFactory::build(null, $apiAction, $controllerAction);
        $rendered  = $view->render();

        return $rendered;
    }