Display Table Column on Report Header [message #612365] |
Wed, 16 April 2014 11:35 |
|
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 |
|
Littlefoot
Messages: 21823 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.
|
|
|
|