views:

47

answers:

1

I would ask it in the form of a question, but I have no idea why I'm getting this exception. I can't find any real documentation online either.

To give you context although I don't think it's really relevant, I'm using it within the JFreeReport classic engine reporting framework.

The stacktrace is:

java.awt.print.PrinterException: Invalid name of PrintService.
    at sun.awt.windows.WPrinterJob.setNativePrintService(Native Method)
    at sun.awt.windows.WPrinterJob.getPrintService(Unknown Source)
    at sun.awt.windows.WPrinterJob.printDialog(Unknown Source)
    at org.jfree.report.modules.gui.print.PrintUtil.print(PrintUtil.java:128)
    at org.jfree.report.modules.gui.print.PrintExportTask.run(PrintExportTask.java:84)
    at java.lang.Thread.run(Unknown Source)

Any ideas or suggestions as to what's happening here would be greatly appreciated!

Update: It would be great to also find some documentation on where and when this error is generated...

A: 

The print service name should be the name of your printer. The PrintUtil class I am using at the moment brings up a dialog listing the printers I have setup in my operating system. Can you print from other applications using your computer?

If not you need to configure your printer, otherwise you may want to check if jFreeReport needs a default printer specified somewhere. Since JFreeReport is open source, you should be able to create a simple test program using just the PrintUtil class - that may make it easier to demonstrate what is going wrong with code.

DrDipshit
Yes, it's possible to print from other applications on the computer.
Stephane Grenier