473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

See Report of JasperReport and Python on Screen.

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
0 1833

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

Similar topics

0
by: Colin Graham | last post by:
I have built a crystal report in Visual studio 2003 and i am now able to display the report on my screen using a .net crystal report viewer. The problem that i have is that the crystal report is...
4
by: pmcgover | last post by:
I enjoyed Paul Barry's September article in Linux Journal entitled, "Web Reporting with MySQL, CSS and Perl". It provides a simple, elegant way to use HTML to display database content without any...
3
by: Birky | last post by:
I have a report which I am opening from a command button within a form. I am using the “DoCmd.OpenReport stDocName” command to open the report but it is automatically printing instead of popping the...
7
by: James Stroud | last post by:
Hello, Does anyone know of an example, however modest, of a screenscraper authored in python? I am using Firefox. Basically, I am answering problems via my browser and being scored for each...
7
by: terryscott | last post by:
Every time I enter Python it resets the monitor resolution to 640 x 480. I am not setting the monitor resolution anywhere. I am currently running Python 2.5 on a Windows XP computer. Any info will...
3
by: bruce | last post by:
Hi... got a short test app that i'm playing with. the goal is to get data off the page in question. basically, i should be able to get a list of "tr" nodes, and then to iterate/parse them....
1
by: bruce | last post by:
Hi Paul... Thanks for the reply. Came to the same conclusion a few minutes before I saw your email. Another question: tr=d.xpath(foo) gets me an array of nodes.
1
by: CD Tom | last post by:
In my application when a user selects some reports I display the reports on the screen one a detail and the other a summary, One report always overlays the other, is there a way to move the one of...
3
by: gayatri mahajan | last post by:
Dim Report As New CrystalReport3 Private Sub Command1_Click() Dim Report As New CrystalReport3 Report.Export = True End Sub Private Sub Form_Load() Screen.MousePointer = vbHourglass
0
by: Vinayadas P V | last post by:
is anybody can guide me to run a SDS/2 report through python script??
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.