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
I need help to see the report on the screen before recording it or sending it to print.
Thank you.
Roberto
Code:
import sys
import os
import PyPDF2
import pyjasper
from platform import python_version
from pyjasper.jasperpy import JasperPy
from PyPDF2 import PdfFileMerger,PdfFileReader
#def advanced_example_using_database():
input_file = os.path.dirname(os.path.abspath(__file__)) + '/report4.jrxml'
output = os.path.dirname(os.path.abspath(__file__)) + '/reportes'
print(input_file)
print(output)
con = {
'driver': 'postgres',
'username': 'postgres',
'password': 'Administra8080',
'host': 'localhost',
'database': 'municipal',
'port':'5432'
}
x=input("Digite codigo de empleado :")
jasper = JasperPy()
jasper.process(input_file,output_file=output,format_list=["pdf"], parameters={'idenifica': (x)},db_connection=con)