How to send a PDF to JasperSoft Server?

Is there a way to send a PDF back to the Server created with a template that comes from a JasperSoft Server? I have a Template on my JasperServer running on Docker. I can display and create my desired PDF on my App and the Template works. Now I want to save that Report that I create back to the server to a special Folder. Is it possible to tell Jasper to save the Report on for Example Report Execution? Maybe with some params or something? 


The Code - creating the PDF from Template: 

    await fetch(
        method: "POST",
        headers: {
          Accept: "application/xml",
          "Content-Type": "application/xml",
        body: `  

Report Execution:

    await fetch(
        method: "GET",

So either in one of those 2 calls OR something I also found but I cant get to work:

        method: "POST",
        headers: {
          'Content-Type': 'application/pdf'
        body: MyPDFfromFolderStructure

When I try this by taking a PDF right from my Folder Structure I get ERROR: Network request failed

Also in generall: Are there any tutorials or "good" Docs for this? All I can see is some basics but no real examples on how to do it via REST. Also the tutorials I've seen from Jasper are bad and cover basics mostly for JasperStudio only.

abusch100's picture
Joined: Apr 11 2022 - 2:31am
Last seen: 3 weeks 3 days ago

1 Answer:

You can use the "jobs service" to trigger an immediate execution of the report and send the pdf to the server at a specific location.

You may also upload the file to the location using the resource service.

sanderse's picture
Joined: Jul 31 2017 - 3:51pm
Last seen: 3 days 3 hours ago