Home » Developer & Programmer » Reports & Discoverer » How to Return Values in a Text or Boiler Plate (Oracle Reports 6i, Windows XP)
How to Return Values in a Text or Boiler Plate [message #543483] Wed, 15 February 2012 00:35 Go to next message
stalin4d
Messages: 204
Registered: May 2010
Location: Tuticorin, Tamil Nadu, In...
Senior Member
Hi,

Well i like to display the Values in Boiler Plate/Text.

For Example, i have Report with Address Columns.
for Tin No: i have Hard coded as TIN: 34XXXXXX01 and
i like to change this hard coded item as TIN: 34XXXXXX02
so during Runtime if the input is changed the above item to be changed.

Inputs given in Report Parameter;

if the input is given as 81

TIN: 34XXXXXX01

if the input is given other than 81

it should print as TIN: 34XXXXXX02

How to give it in the Boiler plate.?

Pls Reply ASAP...

Regards,
Stalin





Re: How to Return Values in a Text or Boiler Plate [message #543486 is a reply to message #543483] Wed, 15 February 2012 00:52 Go to previous messageGo to next message
Littlefoot
Messages: 19476
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Something like this might do the job.
select decode(:input, 81, '34XXXXXX01', '34XXXXXX02')
  into retval
  from dual;
Re: How to Return Values in a Text or Boiler Plate [message #543552 is a reply to message #543486] Wed, 15 February 2012 03:34 Go to previous messageGo to next message
stalin4d
Messages: 204
Registered: May 2010
Location: Tuticorin, Tamil Nadu, In...
Senior Member
As per your reply i have put the coding as below,
but it returns error.


function B_11FormatTrigger return Boolean is
TIN Varchar2(30);
begin
  select decode(:prd_code, '81', '33656220441', '33261562667')
  into TIN
  from dual;   
  return (TIN);
end;


How to return the Values?
Re: How to Return Values in a Text or Boiler Plate [message #543553 is a reply to message #543552] Wed, 15 February 2012 03:38 Go to previous messageGo to next message
cookiemonster
Messages: 10908
Registered: September 2008
Location: Rainy Manchester
Senior Member
You wouldn't do that in a format trigger, you'd do that in a formula column.

Format triggers can only return true or false.
I suggest you create two boilerplate items. One with each value. Than add a format trigger to each that checks prd_code and returns true or false as appropriate.
Re: How to Return Values in a Text or Boiler Plate [message #543570 is a reply to message #543553] Wed, 15 February 2012 06:34 Go to previous messageGo to next message
stalin4d
Messages: 204
Registered: May 2010
Location: Tuticorin, Tamil Nadu, In...
Senior Member
your Reply is the Exactly the Right one cookiemonster.
I followed the same way before your reply...

thanks a lot...

Regards,
Stanlee...

Re: How to Return Values in a Text or Boiler Plate [message #543576 is a reply to message #543570] Wed, 15 February 2012 07:08 Go to previous messageGo to next message
Littlefoot
Messages: 19476
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Though, one item is easier to maintain. So, another option is to create a formula column and put that piece of code in there and display only one item (based on that formula column).

Yet another option is to avoid items at all and create user parameter (let's call it TIN). Populate its value in After Parameter Form trigger (using the same code you already posted; you'd just precede parameter's value with a colon (so it would be "... into :tin ..."). Then, display its value in paper layout editor as
TIN value is equal to &tin
Re: How to Return Values in a Text or Boiler Plate [message #543632 is a reply to message #543576] Thu, 16 February 2012 01:06 Go to previous message
stalin4d
Messages: 204
Registered: May 2010
Location: Tuticorin, Tamil Nadu, In...
Senior Member
yes littlefoot your way for proceedings also we can do,
but cookiemonsters method is little simple and quicker to do with out setting any parameters as you say.

so before his answer i used that option only.

Anyhow thanks for your replies...

Stanlee...
Previous Topic: arabic numbers in report 11g
Next Topic: how to add union to report query
Goto Forum:
  


Current Time: Fri Aug 22 18:59:17 CDT 2014

Total time taken to generate the page: 0.05360 seconds