How to use CheckedListBox output in the Query Wizard ?

I have a controller CheckedListBox and I want pass selected options to query wizard (SQL window) using a parameter.

I have tried to do that but unfortunately the CheckedListBox is returning selected values as a string array instead of a string with commas.

SQL : SELECT * FROM student WHERE Id IN (@StudentIDs);

Please guide on how to do this only using REPORT DESIGNER TOOL.

No code suggestions please.

Comments

  • Hello!

    You can use auto-filtering on the control; to do this, select all the required rows in the query (SELECT * FROM student), then set the DataColumn property for the CheckedListBox on the DialogPage (for example, student.Id) and ensure that AutoFilter = true — FastReport will automatically filter the DataBand based on the selected items without the need for scripts.

    You can also resolve this issue using DataBand.Filter with a string[] parameter: set the following expression in the DataBand.Filter:

    Array.IndexOf((string[])[SelectedIds], ToString([student.Id])) >= 0

This discussion has been closed.