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

Performance - template compiling and image


slavicekpavel

Recommended Posts

Hello, 

I have a question. I am a beginner in jasper and I have to know if is difference in performance between defining an image in a template static or dynamicaly via parameter.

For example I can define the image in template like this:

1) setting parameter

URL url = this.getClass().getClassLoader().getResource("pdf/my_image.tif");parameters.put("logo", url);[/code]

declaration in a template

<parameter name="logo" class="java.net.URL">    <defaultValueExpression><![CDATA[]]></defaultValueExpression></parameter>[/code]


usage in a report/template

<image>   <reportElement x="100" y="30" width="135" height="30"/>   <imageExpression><![CDATA[$P{logo}]]></imageExpression></image>[/code]


2) defines the path in the template

<imageExpression class="java.lang.String">      <![CDATA[$P{REPORTS_DIR} + "/images/logo.jpg"]]></imageExpression>[/code]

Is needed compiling the template repeatedly (see 1)? Is difference between 1 and 2 in performance? 

 

Thank you in advance

Pavel Slavicek

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...