Print Screen from Reports for Python, with JasperReports.

79 views
Skip to first unread message

Roberto Matarrita

unread,
Nov 23, 2017, 5:43:25 PM11/23/17
to JasperReports / iReport Brasil

I found this code posted by Mr Jadsonbr, adapted to my needs, and it works.

I have the following questions.

  1. Can i see the report on screen before you burn it to disk.
  2. How to send parameters to the report, for example the invoice number, company code.

Tanks
Robert
Costa Rica

import sys
import os
import pyjasper
from platform import python_version
from pyjasper.jasperpy import JasperPy

#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'
}
jasper = JasperPy()
jasper.process(input_file,output_file=output,format_list=["pdf"],db_connection=con)

Reply all
Reply to author
Forward
0 new messages