Input Control w/Query Results

1

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!

mdugger's picture
Joined: Feb 17 2015 - 2:25pm
Last seen: 8 months 3 weeks ago

I'm using this query:

SELECT DPT_Name
FROM Departments
ORDER 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_Name
FROM Departments
ORDER 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.

 

mdugger - 4 years 9 months ago

1 Answer:

0

Displaying query input control values basically requires the following:

  • pull data for Value column and Visible column from database with input control (IC) query
  • specify valid field names from your query for Value column and Visible column


Make 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

stasp's picture
16294
Joined: Jun 3 2009 - 9:53am
Last seen: 1 day 1 hour ago
Feedback
randomness