I have a custom report in which I need to add a List Control and populate the control with a simple SELECT statement that returns all of the case names.
SELECT DISTINCT Name FROM Cases
I enter this select statement in the property field, Query, of the list control.
When I try to run the report I get the error: Error populating listbox sql. Unknown error 0x800A0CC1.
How to create a query that returns the case list names?
Thanks.
Did you ever figure this out?
I've encountered this before, you need to return two values with your query.
Text - this will be what is displayed to the user when selecting criteria
ItemData - this is what you would use within your SQL query
So, in your situation a query like below would work.
SELECT DISTINCT Name as 'Text', CasesId as 'ItemData' FROM Cases
If you use this then a simple SQL query to just return the case info for the item they selected would look like this. Assuming the I named the List Control CASE.
Select * From Cases Where CasesId = ?CASE.ITEMDATA?
You might encounter a problem if users enter special characters like " or % within the Name field.