Home » Developer & Programmer » Reports & Discoverer » Set variable as Report header
Set variable as Report header [message #257845] Thu, 09 August 2007 06:06 Go to next message
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.

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 Go to previous message
Messages: 21151
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).
Previous Topic: duplicate rows
Next Topic: Error when I run the report from server
Goto Forum:

Current Time: Wed Aug 23 22:14:06 CDT 2017

Total time taken to generate the page: 0.06654 seconds