Jump to content
Changes to the Jaspersoft community edition download ×

How, Execute and preview jasper report in pdf format without saving the pdf file somewhere


rmatarria

Recommended Posts

I have the following code and it works.What I need is to know how I can do to see the report first on the screen, without first saving it in a folder.The application is desktop.Thank you.Robert..insert your code here..[/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)

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...