mdugger Posted February 17, 2015 Posted February 17, 2015 I'm trying to use query results to retrieve a list of departments from a database, then have those departments appear in a multi-select input control. For the longest time I was getting "(NULL)" for every department in the query, and selecting one of the null results would run the report as if I had selected an actual department. If the department name itself is the first visible query column, I receive a list of null results, but if I use a column which returns integers as the first visible column and the department name column as the second visible column, suddenly the list returns integers followed by department names ("01 | 01 - Grocery"). I'd like to be able to show only department names without first displaying a number, but I can't seem to figure it out. I'm getting the feeling it has something to do with data types, but I don't know enough to pinpoint the problem. The parameter class I'm using is java.util.collection if that helps at all. Thanks!
stasp Posted February 18, 2015 Posted February 18, 2015 Displaying query input control values basically requires the following:pull data for Value column and Visible column from database with input control (IC) queryspecify valid field names from your query for Value column and Visible columnMake sure that you are using correct field names. If you need further assitance, it would be helpful to see your IC query and Value/Visible columns config. - Stas
mdugger Posted February 18, 2015 Author Posted February 18, 2015 I'm using this query:SELECT DPT_NameFROM DepartmentsORDER BY DPT_Name My input control has the same name as the parameter it is linked to (DepartmentList). The value column and visible column are both DPT_Name. This results in a multiple selection list with 44 [NULL] values, which happens to be the exact number of departments we have in the database. If I select one of the null values displayed and run the report, it functions as if the selected value were actually a valid department name. If I use this query: SELECT DPT_PK, DPT_NameFROM DepartmentsORDER BY DPT_Name ...and set the value column of my input control to DPT_Name, but set the visible columns to DPT_PK followed by DPT_Name, I get the exact results I am expecting, which is a list of all 44 primary keys paired with their corresponding department names (something like '2 | Cheese,' '1 | Grocery,' '3 | Mercantile,' etc.). If I take the department name out of the query and set up the input control to display only primary keys, the list functions as expected. Going back and doing the same thing with the DPT_Name column again results in a list of null values. As long as the first or only visible column contains integers, every visible column displays and functions properly. It seems strange that I need to do this at all, but for now I'm using it as a workaround until I can figure out what I'm doing wrong.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now