Jump to content
We've recently updated our Privacy Statement, available here ×
  • Visualize.js: Search for Dashboards, Reports and other resources in repository folder and its subfolders


    stasp
    • Version: v7.1, v7.1.0, v6.4, v6.4.3, v6.4.2, v6.4.0 Product: JasperReports® Server

    Code Sample

    The following code snippet is sufficient to pull a list of available Dashboards (with all relevant metadata) and log an array of Dashboard metadata objects into console:

    visualize({
      auth: {
        name: "joeuser",
        password: "joeuser",
        organization: "organization_1"
      }
    }, function(v) {
      v.resourcesSearch({
        folderUri: "/public/Samples",
        recursive: true,
        types: ["dashboard"],
        success: function(repo) {
          console.log(repo);
        },
        error: function(err) {
          console.log(err);
        }
      });
    });

    If you wish to only search a specific folder but not its subfolder, simply disable the recursive search:

    recursive: true

    You can also search for other resource types, as well as multiple resource types in the same search:

    types: ["dashboard","reportUnit"]

    Here is a client side code sample on JSFiddle.net platform which looks up Dashboards in /Public/Samples directory and renders the list of found Dashboard names in a drop down list:

    https://jsfiddle.net/Stas_P/cn0e7a6b/

    Related articles:

    Visualize.js: How to discover Resource types and Search types available in JasperReports Server repository


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...