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

Problem passing ResourceBundle to Subreport  


Recommended Posts

By: Daniel R - doctor_jay

Problem passing ResourceBundle to Subreport Â

2006-01-12 02:23

Hi,Â

Â

I've got a main report with a couple of subreports. In order to have multi language reports I pass a ResourceBundle object to the main report as parameter in the report parameters map:Â

Â

HashMap params = new HashMap(); Â

...Â

params.put(JRParameter.REPORT_RESOURCE_BUNDLE, myBundle); params.put(JRParameter.REPORT_LOCALE, locale);Â

Â

Then I pass the parameters map to the JasperFillManager method.Â

Â

In the subreport elements in the main report I set the parametersMapExpression as Â

Â

- new HashMap($P{REPORT_PARAMETERS_MAP} -Â

Â

(I also tried - $P{REPORT_PARAMETERS_MAP - )Â

Â

The $R {} text fields are displayed in the main report but in the subreports they are all _null_. Data from the datasources are displayed correctly.Â

Â

Anyone an idea how to solve this?Â

Â

Greetz DanielÂ

 

 

 

 

 

By: Lucian Chirita - lucianc

RE: Problem passing ResourceBundle to Subrepo Â

2006-01-12 06:35

HiÂ

Â

You'll have to pass the resource bundle as an explicit subreportParameter:Â

<subreportParameter name="REPORT_RESOURCE_BUNDLE">Â

<subreportParameterExpression><![CDATA[$P{REPORT_RESOURCE_BUNDLE}]]></subreportParameterExpression>Â

</subreportParameter>Â

Â

HTH,Â

Lucian

 

 

 

By: Daniel R - doctor_jay

RE: Problem passing ResourceBundle to Subrepo Â

2006-01-12 07:12

Thanks a lot. Worked nicely! :-)

 

 

 

 

By: Lucian Chirita - lucianc

RE: Problem passing ResourceBundle to Subrepo Â

2006-01-12 08:16

I've commited a fix to CVS that passes the resource bundle from the bulk parameter values map to the subreport when the subreport doesn't have its own resourceBundle property.Â

Â

Regards,Â

Lucian

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