Auto export

Automatically export a report at a prespecified format.

HTML

<script src="https://mobiledemo.jaspersoft.com/jasperserver-pro/client/visualize.js"></script>

<h4>PDF will automatically export for specified report.</h4>

JavaScript

visualize({
    auth: {
        name: "joeuser",
        password: "joeuser",
        organization: "organization_1"
    }
}, function (v) {
    var report = v.report({
        resource: "/public/Samples/Reports/5g.AccountsReport",
        success: function () {
            report.export({
                outputFormat: "pdf",
                pages: {
                    anchor: "Newton"
                }
            }, function (link) {
                var url = link.href ? link.href : link;
                window.location.href = url;
            }, function (error) {
                console.log(error);
            });
        }
    });
});