views:

41

answers:

2

Say I have a basic lookup table with code and description fields. I have a parameter field in my report. The value of this parameter field will correspond to a record in the lookup table using the "Code" field as the key.

In the header of my report I would like to show the corresponding description value. How best can this done? Is a SubReport, passing the parameter, the only way?

A: 

You don't require a subreport.

You can include your lookup table using the "Database Expert", then you can use the "Select Expert" and ensure that your LookupCode = LookupCodeParameter

Nathan Koop
Here is what I try. I have my main table and the linked "lookup table". I also add the lookup table to the report as a separate alias with no links (And I get the "Multiple Starting Points" warning message). For both I set the parameter value appropriately in select expert. This all works when records from my main table meet the criteria. But nothing is displayed if no records meet my criteria. Example, I have a database of personnel with no "Resigned" people. But my lookup table has Resigned as an option. If I select Resigned I want to display this in my headder with no records.
M Schenkel
+1  A: 

This answer is in response to your comment on Nathan Koops answer.

It sounds like you simply need to change your link. You could make your Main table the lookup table and create a left outer join to your main table. Doing it thins way will show every row in your lookup table and only the rows in the main table that correspond in the main table.

Therefore you could group it so that you get something like the following:

Resigned: 0 Employees

Active: 2 Employees
-Jim
-Bob

I'm making some big assumptions that are probably wrong, but I hope this helps.

Dusty