Set variable as Report header [message #257845] |
Thu, 09 August 2007 06:06 |
sinwei_chee
Messages: 5 Registered: November 2006
|
Junior Member |
|
|
Hi, all
I want to use a return value to be the header, is that doable? if yes, appreciate kind guidance.
Scenario:
User will be prompted to enter a parameters (which is the ID of a record).
The expected result is the NAME column of the tuple results will be displayed as the report header. (assuming only one row will be returned)
Many thanks
[Updated on: Thu, 09 August 2007 06:07] Report message to a moderator
|
|
|
Re: Set variable as Report header [message #257895 is a reply to message #257845] |
Thu, 09 August 2007 07:47 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Create another user parameter (for example, PAR_NAME). Use input parameter value (for example, PAR_ID) in AFTER PARAMETER FORM trigger as
SELECT MAX(name) INTO :par_name
FROM some_table
WHERE id = :par_id;
Create header field and make PAR_NAME parameter to be its source.
MAX function is here to ensure only one value is returned (so that you wouldn't have to write EXCEPTION handler; however, it is better to take control over exceptions, so ... in production, think twice about it).
|
|
|