assiacpge2011 Posted May 13, 2015 Share Posted May 13, 2015 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. Link to comment Share on other sites More sharing options...
hozawa Posted February 14, 2019 Share Posted February 14, 2019 What are you trying to do? JasperReports return a pdf so there's no need to use ReportLab. You're probably getting blank pages because you're feeding pdf into ReportLab. That is, you don't need ReportLab but just need to save the returned stream directly to a file. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now