Report Filter parameter(List) as combobox(drop-down)

Hi,

I wanted to pass dynamic values(List) as in form of combobox(drop-down) values in reports filter parameter, since parameter type has options like List of entities, entity, string etc I am unable to pass list(fetched from query) to parameter type.

IMG_20230130_173645__01

You don’t have to declare report parameters if you pass them using the report execution API.

For example, if you define the following Groovy dataset in a report band:

def users = params['users']
return users.collect { 
    ['username': it.username, 'firstName': it.firstName, 'lastName': it.lastName] 
}

then you can just pass the users parameter as follows, without any additional definition:

@Autowired
private CollectionContainer<User> usersDc;
@Autowired
private UiReportRunner uiReportRunner;

@Subscribe("runReport")
public void onRunReportClick(Button.ClickEvent event) {
    List<User> users = usersDc.getItems();

    uiReportRunner.byReportCode("user-list")
            .addParam("users", users)
            .runAndShow();
}

Also can you share a demo project for better understanding

Let’s do it another way: you share a sample project and explain your problem, I try to propose a solution.