Jump to content
We've recently updated our Privacy Statement, available here ×

mdugger

Members
  • Posts

    3
  • Joined

  • Last visited

mdugger's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I'm running JasperSoft Studio 6.0.1, and have been attempting to design a report with input controls for starting and ending dates that will return data from a SQL Anywhere database. While doing so, I discovered that I am unable to use more than one SQL variable having a report parameter as a value in a query. Adding the following lines to the beginning of any query (or doing this sort of thing in general) returns the error "[sybase][ODBC Driver] Not enough values for host variables:"DECLARE @DStart DATEDECLARE @DEnd DATESET @DStart = $P{Date_1}SET @DEnd = $P{Date_2} Assigning parameter values to more than one SQL variable always results in this error, but if I use just one parameter and hard-code the value of the other variable into the SQL script the report runs as expected. I also tried eliminating variables and adding the parameter results to the query where necessary, but received the same error. Changing to parameter class doesn't seem to make a difference. Is there a reason why this might be happening?
  2. 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.
  3. 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!
×
×
  • Create New...