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

Bundle in list component


almoes16

Recommended Posts

 Hej people!

I'm working with the component list in iReport, in the list I have 3 different fields. One of them is a field from I would like to get a String that I get from the Report_Resource_Bundle. So I thought to write this code in the textfield, as I have done in other parts of the report where textfields where not inside the list component:

$P{REPORT_RESOURCE_BUNDLE}.getString($F{category})

The problem is that when the report is created I get a "null" in the textfield. I wrote exactly the same code but positioning the textfield outside the list and I get the String I want.

Can someone help me? Thanks in advance!

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I have been trying and I got a solution:

in the datasource of the list appear the parameter REPORT_RESOURCE_BUNDLE, but in spite of it has the same name as the parameter "REPORT_RESOURCE_BUNDLE" of the report, it is not the same parameter. So we must add:

<datasetParameter name="REPORT_RESOURCE_BUNDLE"> <datasetParameterExpression><![CDATA[$P{REPORT_RESOURCE_BUNDLE}]]></datasetParameterExpression>

</datasetParameter>

In this code we introduce REPORT_RESOURCE_BUNDLE from the report in REPORT_RESOURCE_BUNDLE from datasource.

Link to comment
Share on other sites

I don't understand the problem, but I understood the solution! :)  I was just writing up some internal documentation yesterday and included this kind of example where you want to use a parameter from the main data set while you're inside a subdataset for a List, Table, etc.  Yes, you either have to add that jrxml code manually or else you can right click on the List and choose "Edit list datasource" (the same area where you tell the list which Sub dataset to use and tell it to use connection $P{REPORT_CONNECTION}), and choose the Parameters tab.  Each time you add a parameter (and it's easier if you've already defined the parameter in your subdataset, because you can just select it instead of typing in the name you plan on giving it), you also specify an expression from the main dataset that should be passed to that subdataset parameter--sometimes it's a main parameter, sometimes it's a field, variable, function, or some combination of those.

Carl

Link to comment
Share on other sites

The problem was I was confused with the name of the parameters, I thought the names the estandard parameters have in datasource where the same as in the report because they were the same variables, but it was not correct. Anyway thanks for your answere and for the optional way you explained me for add a value to the parameter in datasource.
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...