US and Worldwide: +1 (866) 660-7555
Results 1 to 4 of 4

Thread: How to automatically choose the default printer in the report preview Dialog?

  1. #1
    Join Date
    Sep 2004
    Posts
    10

    Default How to automatically choose the default printer in the report preview Dialog?

    Hi all,
    My application is based on the last version of JFreeReport (0.8.10). I use the PreviewDialog to preview the report before printing.
    Everything is ok, but the fact that in the print window the default printer is not always automatically selected. (As it was in the previous versions)

    I have various clients with windows 2000 and xp and one on linux. The problem is verified mainly on Windows XP and 2000 (not always), on linux it seems to work.

    The PreviewFrame is started with this code:

    URL in = getReportDefinitionSource();
    this.report = parseReport(in);
    this.report.setDataFactory(new TableDataFactory("default", data));
    PreviewDialog frame = new PreviewDialog(this.report);
    frame.pack();
    frame.setVisible(true);
    frame.requestFocus();


    What is wrong?

    Thank you all in advance,
    Luca

  2. #2
    Join Date
    Sep 2004
    Posts
    10

    Default

    Hi all again,
    If there are no ways to automatically choose the default printer in the PreviewFrame, it is possible to select a particular printer by default?

    Thank you all,
    Luca

  3. #3
    Join Date
    Mar 2003
    Posts
    7,558

    Default

    All the printer management is done by the JDK.

    In theory, the JDK should come up with the default printer defined in your system. At least with the JDK 1.2 code, we have no chance to select a printer, as the Java-API offers no way to do this. For JDK 1.4 printing, there exists the possiblity to select a printer manually in the Java-API. However, our code does not make use of this ability. Again we rely on the JDK to come up with a good printer.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  4. #4
    Join Date
    Sep 2004
    Posts
    10

    Default

    Taqua,
    thank you for the fast reply.

    I remember that with a previous version of JFreeReport (I don't know exactly the number, but it is maximum three four versions before), this problem was not present. In the preview dialog the right printer was choosed automatically.

    Maybe I can verify which printers are registered in the JDK and how it assignes the default printer.

    Thank you again,
    Luca

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •