Display Table Column on Report Header [message #612365] |
Wed, 16 April 2014 11:35 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/c514fffdfe7aab065b12f1f8ace8f6c1?s=64&d=mm&r=g) |
Adeel Qadir
Messages: 48 Registered: November 2013 Location: Pakistan
|
Member |
|
|
Hello Experts,
Using Report Builder 6i
In my project i have a table that name is 'Company Information Form'
I want to display Company Name in all reports header from Company information Table.
please help me how can i display Company name in report header from company table.
[Updated on: Wed, 16 April 2014 11:39] Report message to a moderator
|
|
|
Re: Display Table Column on Report Header [message #612370 is a reply to message #612365] |
Wed, 16 April 2014 14:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21811 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
As you want to display it in ALL reports, maybe the simplest option would be to create a report template and then base all your reports on it.
In order to display company name, you could do that by either performing SELECT ... INTO in a report (for example, in its After Parameter Form trigger) or by creating a stored (database) function which would return that value. Basically, function's code would be equal to the report trigger's one.
First, create a user parameter, let's call it PAR_COMPANY_NAME. Code which selects the value would look likeselect company_name
into :par_company_name
from company_information_table
<WHERE clause goes here, if necessary>
If you choose to use a function, report would contain only:par_company_name := f_company_name; where F_COMPANY_NAME is a stored function, such ascreate or replace function f_company_name
return company_information_table.company_name%type
is
retval company_information_table.company_name%type;
begin
select company_name
into retval
from company_information_table
<WHERE goes here>;
return (retval);
end;
Finally, in report's (or template's) header, create a field whose source is previously created (and populated) user parameter: PAR_COMPANY_NAME. That would be all.
|
|
|
|