Jump to content
Changes to the Jaspersoft community edition download ×

Printing jasper report from linux - Urgent


2005 IR Help

Recommended Posts

By: Ritesh - sharmaritesh

Printing jasper report from linux - Urgent

2004-02-20 04:23

Hi !

 

I am using a piece of Japer reports code to generate, save and then print a PDF report. The code is like:

------------------------------------------------

//############## load the template and fill the report ##############

JasperReport jReport = JasperManager.loadReport(templateName);

 

JasperPrint jPrint = JasperManager.fillReport(jReport, parameters,lDataSource);

 

//############## form the file name and save the report ###############

 

JasperExportManager.exportReportToPdfFile(jPrint, fileFullNameForSave);

 

//############## set the report settings for printing and print the report ##############

jPrint.setName(fileName);

jPrint.setOrientation(JRReport.ORIENTATION_PORTRAIT);

 

JasperPrintManager.printReport(jPrint, false);

-------------------------------------------------

 

This code works perfectly when i run it through TomCat server on windows. It saves the file to the specified location and also fires it for print, taking the default printer settings.

 

The problem arises when i port this code to Weblogic (on linux). There the last statement ' printReport' gives the exception with message "Error in printing report".

 

One reason i can think of is that the printer might not be properly installed for my linux instance.

 

Can anybody pleaseeeeeeeee tell me how to go about this whole thing? Is there anything extra that i have to do for printing the report from linux? Is there any other way i should be doing this?

 

any help wil be highly appreciated as i can't stress enough on how urgent this is..plus i haven't worked on linux all that much.

 

Thanx in advance

 

 

 

 

 

By: Israel Lifshitz - sisraell

RE: Printing jasper report from linux - Urgen

2004-02-20 09:16

Please send the exception details.

 

 

 

 

By: Dan - danielluk

RE: Printing jasper report from linux - Urgent

2004-02-20 09:42

Not sure about your problem, but have you export JAVA_HOME and JAVA_OPTS. Usually JAVA_OPTS is the problem if your JasperReport works on windows.

 

export JAVA_OPTS="-Djava.awt.headless=true".

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...