Jump to content

iReports 5.1.0 adding multi select filter to data source that is applied at runtime


wixsom

Recommended Posts

Hi,

Been looking for several hours for an answer to this. I have a data set that has several hundred rows (too large to view in a single Line Chart). I'm able to capture a 10 row subset of that data, save to a mysql table and generate a nice Line Chart (so that part works fine) . Now, I want to change the data source to the full data set and add a multi select pulldown to 'filter' the data at runtime to show (for example) selected zip codes and/or area codes and/or some other column in the dataset. I've seen samples of this but cannot find info on how you create a new report in iReport and add this functionality to a Line Chart. Thanks for any help.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

This is how I'm using multi-select input controls.

Create a Parameter, giving it a name  and assigning the class java.Util.Collection.  You can assign default values by using an expression like java.util.Arrays.asList(new String[]{"value1","value2"})

In your query, in the where statement place 'WHERE $X{IN, DB_FIELD, PARAM_NAME}'  You could also use this syntax elsewhere in the report.

So my query may end up looking like:

SELECT id, metric

FROM ex_table

WHERE $X{IN, id, id_list}

 

Link to comment
Share on other sites

  • 1 year later...

Quiero USAR Varias Consultas en mi informe. Pero El Informe principal de Que Me permite Solo Una consulta director, embargo de pecado, encontrado Una Manera De Tener Varias Consultas en mi informe y Que se REALIZA Por subdataset en iReport. Pero no estoy en las Condiciones de acceder a este Los Campos de mi subdataset En Mi principal-Informe. ¿Como hacer la ESO?

 

Gracias!

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