By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

See Report of JasperReport and Python on Screen.

P: 1
I have the following code that generates a report made in JasperReport and executed in Python, for a desktop application.
I need help to see the report on the screen before recording it or sending it to print.

Thank you.
Roberto

Expand|Select|Wrap|Line Numbers
  1. import sys
  2. import os
  3. import PyPDF2
  4. import pyjasper
  5. from platform import python_version
  6. from pyjasper.jasperpy import JasperPy
  7. from PyPDF2 import PdfFileMerger,PdfFileReader
  8.  
  9.  
  10. #def advanced_example_using_database():
  11. input_file = os.path.dirname(os.path.abspath(__file__)) + '/report4.jrxml'
  12. output = os.path.dirname(os.path.abspath(__file__)) + '/reportes'
  13. print(input_file)
  14. print(output)
  15.  
  16. con = {
  17.         'driver': 'postgres',
  18.         'username': 'postgres',
  19.         'password': 'Administra8080',
  20.         'host': 'localhost',
  21.         'database': 'municipal',
  22.         'port':'5432'
  23.     }
  24. x=input("Digite codigo de empleado :")
  25. jasper = JasperPy()
  26. jasper.process(input_file,output_file=output,format_list=["pdf"], parameters={'idenifica': (x)},db_connection=con)
Nov 28 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.