Jump to content
We've recently updated our Privacy Statement, available here ×

JasperViewer x Windows Terminal Server


edilmar

Recommended Posts

Hi,

 

I use JasperReports in my JDK6 Swing app, with JasperViewer, and there are many remote users with WTS clients.

 

I have also a Delphi7 + QuickReport app with WTS clients.

 

When users display JasperViewer, I think it generates an image, not like QuickReport, that creates Windows labels for any component.

 

Problem: users think Java app is slower than Delphi app, because the behaviour of the frame display is like a remote VNC access.

 

Is there some way to solve this? Other way to display Jasper?

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Java is slower simply because it has to convert the Java byte code into machine code whereas Delphi compiles executables directly to machine code. There is nothing you can do to change this. This, by the way, should be common knowledge for any Java programmer!

 

About displaying jasperreport differently. You can export to pdf, html, word and excel but these exports arent't faster, actually they are just as slow/fast as jasperviewer in my expierence.

Link to comment
Share on other sites

Hi friend,

 

I know Java is slower than Delphi because byte-code x native code. But my doubt was about a JasperViewer problem, not really Java problem.

 

I look at JRViewer.java code and it renders all the report like a image. This is the problem when running built into Windows TS clients. Because WTS has some tricks to send not "a image" (like VNC) but "system calls to internal API", there is a better performance to remote users. However, JRViewer image generated must be sent without this trick, all image information goes to remote user, much slower than Delphi's QuickReport, that renderizes labels (and other components) in a white background dialog or frame.

Link to comment
Share on other sites

Your situation is clear now.

 

Is it possible to display html on the server? You could generate html using the HTMLExporter. How about loading a pdf on the server? Maybe you could generate a pdf on a samba share and then send the link to the pdf to the client.

 

Apart from this I dont think there is a solution since you want all the work done on the server but the result send to the client.

 

You could also try jasperserver. This is a web application that will allow you to host jasperreports and export them as well to pdf, excel and word. You can allow your clients to view the page.

Link to comment
Share on other sites

edilmar wrote:

I look at JRViewer.java code and it renders all the report like a image.

 

Which version are you looking to? This is no longer the case since JR 1.2.0.

 

If you use a newer version, please look again at the JRViewer code. It uses the net.sf.jasperreports.viewer.render.buffer.max.size property to decide whether to use a buffered image to render a report page; the default value of this propery is 0, which means that buffered images will never be used.

 

Regards,

Lucian

Link to comment
Share on other sites

Hi friends,

 

I have used JasperReports 1.3.0.

Then, I look into JRViewer.java and found in line 124:

Code:

/**
* Maximum size (in pixels) of a buffered image that would be used by {@link JRViewer JRViewer} to render a report page.
* <p>
* 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.
* </p>
* <p>
* 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.
* </p>
*/
public static final String VIEWER_RENDER_BUFFER_MAX_SIZE = JRProperties.PROPERTY_PREFIX + "viewer.render.buffer.max.size";

 

I'll try to change this value to test. But my doubt now is: what's the real meaning of changing this field to a big value, in terms of RAM using? I didn't understand the comments above.

 

And what about better remote WTS clients access?

Link to comment
Share on other sites

edilmar wrote:

I'll try to change this value to test.

 

I thought you don't want JRViewer to use images when rendering report pages. The default value of this property (which is 0) means that JRViewer would never use images. Why do you want to change the value now?

 

And what about better remote WTS clients access?

 

What do you mean by this question? JRViewer is just a Swing component that renders some standard Swing/AWT content.

 

Regards,

Lucian

Link to comment
Share on other sites

Hi friend,

 

I thought "size" property was to define some cache for components, not using images. But if you say "size=0" means no image is used, only pure Swing components to display the report, then I don't know why reports with JasperViewer are so much slower than normal Java Swing frames/dialogs when using WTS clients.

 

I have many normal Swing frames/dialogs with JTextFields, JComboBox, JTables, etc, and WTS renderizes great for remote users. But when the users call reports, JasperViewer frame is very slow, and property size=0 in source code. If you say JasperViewer uses Labels, Lines, Retangules, etc components to create the report viewer, it would renderize like normal Swing windows, faster for users.

Link to comment
Share on other sites

It has to compile the report first and then convert it all to swing. There is a big difference with normal Swing applications where the swing components are drawn directly (Position already known, size etc) and with the reports there is a more server load because of report generation.

Post edited by: martynhiemstra, at: 2007/11/14 13:46

Link to comment
Share on other sites

But I think there is not only this time increase. I think there is some kind of image process also with size=0, because the behaviour in remote access is bad, VNC-like.

 

When running the same report in a LAN, it is very faster than. The users don't see so much difference in performance when call a normal Swing frame or a JasperViewer report.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...