Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6973283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:05:17+00:00 2026-05-27T17:05:17+00:00

I am using a JasperViewer to display the report inside of a Java desktop

  • 0

I am using a JasperViewer to display the report inside of a Java desktop application.
The report consists of 2 pages – each of them represents an image.

The problem is, when user scrolls the page inside the viewer, there are huge freezes.
The size of image isn’t so big, about 1000×1000.

The image is generated in this way:

private BufferedImage createImage(Component panel) {
    int w = (int) panel.getSize().getWidth();
    int h = (int) panel.getSize().getHeight();
    BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = bi.createGraphics();
    panel.paint(g);
    g.dispose();
    return bi;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:05:18+00:00Added an answer on May 27, 2026 at 5:05 pm

    The issue is resolved. There is a parameter in the JRViewer:

    //Maximum size (in pixels) of a buffered image that would be used by {@link JRViewer JRViewer} to render a report page.
    //If rendering a report page would require an image larger than this threshold
    //(i.e. image width x image height > maximum size), the report page will be rendered directly on the viewer component.
    //If this property is zero or negative, buffered images will never be user to render a report page.
    //By default, this property is set to 0.
    public static final String VIEWER_RENDER_BUFFER_MAX_SIZE
    

    So, if this parameter is set, the reports is drawn as an ImageIcon on a JLabel. Otherwise, it’s drawn using JRGraphics2DExporter that is much more slower when working with big images.

    So the solution is to set the specified property in the property file or using way like this:

     /**
     * This number represents maximum size of an image ( x*y )
     * So this value cover up to 300% zoom for an image 1000x1000 pixels
     */
    public static final String MAX_PIXELS_NUMBER = "10000000";   
    
    static {
            try {
                JRProperties.setProperty(JRViewer.VIEWER_RENDER_BUFFER_MAX_SIZE, MAX_PIXELS_NUMBER);
            } catch (Exception e) {
                System.err.println("Cannot set the VIEWER_RENDER_BUFFER_MAX_SIZE property. Reports will be rendered slowly.");
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using JDeveloper , I started developing a set of web pages for a project
Using intellij and maven pom files, how do i debug tests run inside the
I'm working on my final year project using java swings and jasper reports for
Using report builder 3.0, I have a report that queries a cube. How do
using VB.Net2010 I need to call a C# DLL The problem I have is
Using Java, how can I extract all the links from a given web page?
I have a example for dynamic jasper report. I am using NetBeans IDE. I
Using mercurial, I've run into an odd problem where a line from one committer
Using Android TelephonyManager an application can obtain the state of data activity over the
Using Browserlab, it appears that the background image is not centred in Firefox7 for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.