JasperReports Properties

I know that this is probably a little belated considering how far down the road you guys are with the header subreport implementation

but have you considered the option of using a resourcebundle / properties file

It could make customization a lot faster

 

eg.

ApplicationResource.properties

baseFontName =  "SansSerif"

 

then in jrxml

<font fontName = "$R{baseFontName}" />

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: JasperReports Properties

Ben - thanks for this information.  The resource bundle facility may be very useful with some things.  I will have a play.

Thanks, Tim G

Re: JasperReports Properties

Yeah the only problem Tim is it will need to be placed in the classpath of the application which might mean it needs to be bundled into the application.  I dont think you can declare a path.

 

Its declared in the opening part of a jrxml specification  

<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Vaccination_Certificate" 
language="groovy" pageWidth="595" pageHeight="842" 
whenNoDataType="BlankPage" columnWidth="555" leftMargin="20" 
rightMargin="20" topMargin="20" bottomMargin="20" 
resourceBundle="OpenVPMSApplicationResources"
 uuid="c3c5d235-b961-4be8-ab6e-118ee6c6e815">

Interestingly you can also declare locales that overwrite default props similar to the OpenVPMS inbuilt locales. Eg.

  • OpenVPMSApplicationResources.properties
  • OpenVPMSApplicationResources_en_AU.properties

and so forth

This could mean that we declare styles fonts and fontsizes in a properties file that means you could complete consistency across all designed reports and only make the change in one place.  With the new header feature as well as this it could make report customization very quick and very valuable to the clients/practices.

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: JasperReports Properties

We also need to consider the fact that as soon as we allow users access to a properties file and they might add new properties that clash with existing application properties, I believe properties cascade but I could be wrong...Tim A may need to comment here.

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: JasperReports Properties

Ben - I was only thinking about handling the locale dependent stuff in the resource bundle. eg the tax name varies between GST, VAT, 'State Tax' as a function of AU, UK/ZA,US

I was not intending to use it to contain things like the payments instructions.

Hence I don't see that most users will have any need to play with the report resource bundle.

Regards, Tim G

Syndicate content