with Python and Jasperserver REST API I'm sending http requests to generate a PDF Report but I get blank PDFs. I'v looked for a solution over the net but couldn't solve the problem. I don't know if it's a problem with jasperserver or with my Script or with encoding.
When I try to export the report in HTML format I get it with no problem...but my aim is to have PDF reports not HTML ones.
my PDF export is fine on Ireport and Jasperserver...but not with my Python Script.
My report is containing charts,tables and colors ..and I'm using SanSerif font.
Below is the last part of my Script and there is the last http request that generates the PDF report:
p=s.get('http://host:port/jasperserver/rest/report/*theUUID? file=report&RUN_OUTPUT_FORMAT=PDF',stream=True)
c = canvas.Canvas('fileName.pdf')
c.save()
des=open('fileName.pdf','w')
des.write(p.text.encode('utf-8', 'replace'))
des.close()
the Result is a blank PDF 'fileName.pdf' that has 3 pages (when I run the same report on Ireport or Jasperserver I get 3 pages but not blank)
I'm using Requests for http requests and Reportlab to create the PDF file
Please I need Help.