Search code examples
jasper-reportsjasperserver

JasperReports Server Pro - open reports in new browser tab/window


In JasperReports Server Pro 4.5, is there any way to force the program to open reports/repository elements in a new browser tab or window?


Solution

  • You should be able to fix that by updating the relevant JavaScript file to force everything to open in a new tab. In JRS 4.5.1 it's line 766 in the file .../jasperserver-pro/scripts/repository.search.actions.js

    repositorySearch.RedirectAction.createRunResourceAction = function(resource, inNewTab) {
        if (!resource) {
            resource = resource ? resource : repositorySearch.model.getSelectedResources()[0];
        }
    
        var factoryMethod = repositorySearch.runActionFactory[resource.typeSuffix()];
    
        if (factoryMethod) {
            /* return factoryMethod(resource, inNewTab);  this was the original */
            return factoryMethod(resource, true);
        } else {
            return new repositorySearch.Action(function() {
                alert("Run action for resource type '" + resource.resourceType + "' is not implemented!");
            });
        }
    };
    

    I cannot claim credit for figuring it out. Thanks to Igor Nesterenko for this solution.