RESTfull API to Call a Report

オフライン

(11SP14) I am trying to create a (html) client that will run a report on a custom itemtype. This is the Report that you create with a Query and a stylesheet. Is it possible to do this with the REST API? Would it be possible to get the Report as it shows up in Aras? Or would it only get the data, that will then have to be transformed and formatted again?  Here’s the report we get right now in Aras:

 

And here’s the report item, the query and the attached stylesheet return the above report.

Thanks.

Parents
  • Hi Kamran,

    Here is the general approach I'd recommend:

    1. Create a server-side method in Aras that does the following:
      1. Accepts a report name or id and an item id as parameters
      2. Retrieves the report item's stylesheet and report query properties
      3. Replaces the {@id} placeholder in the report query string
      4. Loads the report query AML into an Item and apply it to the server, or use applyAML()
      5. Performs an XSL transform on the response from step D using the report's stylesheet
      6. Returns the HTML string resulting from the XSL transformation
    2. Call that server-side method via the REST API, passing in the name/id of the report and the id of the context item you want to run the report on.
    3. Parse the HTML out of the resulting JSON response from your REST call.
    4. Display the HTML however you want in your client.

    Alternatively, you could perform steps 1e and 1f in your client application if you prefer.

    Hope this helps!

    Eli


    Eli Donahue

    Technical Product Manager

Reply
  • Hi Kamran,

    Here is the general approach I'd recommend:

    1. Create a server-side method in Aras that does the following:
      1. Accepts a report name or id and an item id as parameters
      2. Retrieves the report item's stylesheet and report query properties
      3. Replaces the {@id} placeholder in the report query string
      4. Loads the report query AML into an Item and apply it to the server, or use applyAML()
      5. Performs an XSL transform on the response from step D using the report's stylesheet
      6. Returns the HTML string resulting from the XSL transformation
    2. Call that server-side method via the REST API, passing in the name/id of the report and the id of the context item you want to run the report on.
    3. Parse the HTML out of the resulting JSON response from your REST call.
    4. Display the HTML however you want in your client.

    Alternatively, you could perform steps 1e and 1f in your client application if you prefer.

    Hope this helps!

    Eli


    Eli Donahue

    Technical Product Manager

Children
No Data