Jasper reports Media problem

Posted on 2006-06-07
Last Modified: 2008-01-09
Hello experts,

I currently have Java application which uses Jasper Reports for printing invoices. I am now moving to a different invoice paper size (currently US Letter, moving to HalfLetter which is 8.5 x 5.5). I have defined the size in Windows Print Server->Forms correctly and can print to that media type from acrobat pdf (generated from iReport) but in the Java application the same (it looks the same anyway) printer dialogue does not offer that Media size as an option.

I don't think that this is a Jasper issue but rather a Java printing issue.

Does anyone know how to get windows defined paper sizes into the Java print service dialogue?

Please help soon as I am under the gun on this one.

Thanks in advance.

Question by:gdrnec
    LVL 92

    Accepted Solution

    If you want to use a set paper size, then why are you giving the user option?
    Why not instead set the paper size in your application
    LVL 4

    Author Comment

    Thanks for the reply. I have no problems enforcing a paper size on the user. However, I can't figure out how to do this. The link you posted covers the java.awt.print classes whereas I seem to have to use the javax.print classes because of Jasper. I can't see how these two meet up.

    I can see how the paper size is set in the awt version using the Paper.setSize(d, d) method and using that in conjunction with the PrinterJob class but can you explain how to cross the two frameworks?

    Am I making any sense?
    LVL 92

    Expert Comment


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now