Jump to content
We've recently updated our Privacy Statement, available here ×

URGENT: Help on running to pdf


2005 IR Help

Recommended Posts

By: racz - raczcandy

URGENT: Help on running to pdf

2004-05-20 01:34

How can i run my report into a pdf file... what's the syntax... i can only save it to pdf using:

 

JasperExportManager.exportReportToPdfFile(reportsPath + reportName + ".jrprint", reportsPath + reportName + ".pdf");

 

what should i substitute to this... Thanks!

 

 

 

 

By: C-Box - c-box

RE: URGENT: Help on running to pdf

2004-05-20 01:55

Hi,

 

first, stop posting every thread with "URGENT"... what is not urgent anybody is posting here!?!?!?

 

I don't know what you want with PDF, doesn't work the JRExporter or what do you mean?

 

Try this method... that print's into a PDF also:

 

JasperPrintManager myJPM = new JasperPrintManager();

myJPM.printReportToPdfFile(jasperPrint,"C:/test.pdf");

 

where "jasperPrint" holds your filled report.

If you want to show it directly in Acrobat, that's another topic what is not related with JasperReport at all.. the goal is the PDF-file... what you do with it is your part, isn't it?

 

hth

C-Box

 

 

 

 

By: Chuck Deal - cdeal

RE: URGENT: Help on running to pdf

2004-05-20 05:38

JasperExportManager.exportReportToPdfStream

 

 

 

 

By: racz - raczcandy

RE: URGENT: Help on running to pdf

2004-05-20 07:15

sorry 'bout that URGENT thing.

 

How can i display a pdf file directly when i run my program? my syntax just saves it... thnx!

 

 

 

 

By: Chuck Deal - cdeal

RE: URGENT: Help on running to pdf

2004-05-20 07:21

It depends on your environment.

 

Give us a (simple) scenario. It's more than likely someone out here is doing something similar and can give you some pointers.

 

JasperReports is just a way to GENERATE the report. HowWhyWhenWhere you display the report is completely up to you and your application.

 

 

 

 

By: Carlos Costa e Silva - carloscs

RE: URGENT: Help on running to pdf

2004-05-20 11:25

After creating the pdf file (in windows):

 

Runtime.getRuntime().exec("rundll32 shell32.dll,ShellExec_RunDLL " + reportsPath + reportName + ".pdf");

 

This works if acrobat viewer is installed.

 

 

 

 

 

By: racz - raczcandy

RE: URGENT: Help on running to pdf

2004-05-21 23:00

what's d other solution to this?

Runtime.getRuntime().exec("rundll32 shell32.dll,ShellExec_RunDLL " + reportsPath + reportName + ".pdf");

 

i've tried this but there's an error in accessing d file... the error is something like file does not exist... but if i do it outside my program, the pdf file works... why?

 

what if i'm running it in solaris?

 

Thanks!

 

 

 

 

By: Carlos Costa e Silva - carloscs

RE: URGENT: Help on running to pdf

2004-05-24 05:59

> why?

 

Problem between chair and keyboard.

 

Possible steps to reduce the symptoms:

 

Log the command line and check that it has no errors.

 

Before invoking exec log the result of new File(reportsPath + reportName + ".pdf").exists() and verify that the file does indeed exist.

 

Post a code excerpt.

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