Re: [Ikvm-developers] Select Printer in JasperReports Preview
Brought to you by:
jfrijters
|
From: Volker B. <vb...@in...> - 2015-06-29 14:10:54
|
This should be work. I think you need to add debug code to see in which
case it run. Do you use PrintJob or PrinterJob?
Volker
Am 29.06.2015 um 12:44 schrieb Michael Kolowicz:
>
> Hallo,
>
>
>
> Danke für die Email. Es kommt leider keine Fehlermeldung. Das einzige
> ist, dass ich den Button drücke kann, dann wehcselt die Maus
> kurzzeitig in den „Beschäftigt“-Modus. Wenn der beendet ist, dann
> passiert nichts weiter.
>
>
>
> Folgender Code wird aufgerufen:
>
>
>
> printJob.setPageable(book);
>
> *try*
>
> {
>
> *if*(withPrintDialog)
>
> {
>
> *if*(printJob.printDialog())
>
> {
>
> printJob.print();
>
> }
>
> *else*
>
> {
>
> isOK= *false*;
>
> }
>
> }
>
> *else*
>
> {
>
> printJob.print();
>
> }
>
> }
>
>
>
>
>
> Die printJob-Klasse befindet sich in dem java.awt.print package
>
>
>
> /**
>
> * Presents a dialog to the user for changing the properties of
>
> * the print job.
>
> * This method will display a native dialog if a native print
>
> * service is selected, and user choice of printers will be restricted
>
> * to these native print services.
>
> * To present the cross platform print dialog for all services,
>
> * including native ones instead use
>
> * <code>printDialog(PrintRequestAttributeSet)</code>.
>
> * <p>
>
> * PrinterJob implementations which can use PrintService's will update
>
> * the PrintService for this PrinterJob to reflect the new service
>
> * selected by the user.
>
> * *@return*<code>true</code>if the user does not cancel the dialog;
>
> * <code>false</code>otherwise.
>
> * *@exception*HeadlessException if GraphicsEnvironment.isHeadless()
>
> * returns true.
>
> * *@see*java.awt.GraphicsEnvironment#isHeadless
>
> */
>
> *public**abstract**boolean*printDialog() *throws*HeadlessException;
>
>
>
>
>
>
>
>
>
> Freundliche Grüße / Best regards
>
>
>
>
>
> *Michael Kolowicz*
>
> Systementwickler
>
>
>
> What exactly do you find in the source code?
>
> Do you receive any exceptions?
>
> Volker
>
> Am 28.06.2015 um 12:02 schrieb Michael Kolowicz:
>
> Hello,
>
>
>
> In my .NET application I have implement the using of a Java-JAR
> that manage my printouts. I have following problem when I show up
> the Print-Preview Window. In the Header is a button to print to a
> installed printer. If I press the button nothing happens. In the
> sourcecode of jasperreports I find out that the
> out-of-the-java-awt-box dialog is using to show up the printers. I
> think that your AWT-Class not implement the needed dialog. Do you
> have a idea how can do that?
>
>
>
>
>
> Freundliche Grüße / Best regards
>
>
>
>
>
> *Michael Kolowicz*
>
> Systementwickler
>
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> Monitor 25 network devices or servers for free with OpManager!
>
> OpManager is web-based network management software that monitors
>
> network devices and physical & virtual servers, alerts via email & sms
>
> for fault. Monitor 25 devices for free with no restriction. Download now
>
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
>
>
>
>
> _______________________________________________
>
> Ikvm-developers mailing list
>
> Ikv...@li... <mailto:Ikv...@li...>
>
> https://lists.sourceforge.net/lists/listinfo/ikvm-developers
>
>
>
|