Home » Developer & Programmer » Forms » formating triggers
formating triggers [message #86394] Mon, 27 September 2004 21:48 Go to next message
shish mate
Messages: 49
Registered: February 2004
Member
how to use foramting trigars to colour my report
Re: formating triggers [message #86407 is a reply to message #86394] Tue, 28 September 2004 03:30 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
This you may do by making use of SRW package of the reports.
You may do this manullay by writing Format trigger or you may do this interactively by opening Property sheet of the object and click on "CONDITIONAL FORMATTING" and choose the required options from there.

Here is a sample code of Format trigger in which if a field EMP_NO is greater than 10 then report should chnage the color of this feild to RED,Font to Courier,Bold and size to 12.

function F_AIT_TYPE_DESCFormatTrigger return boolean is
begin

-- Automatically Generated from Report Builder.
if (:EMP_NO > '10')
then
srw.set_text_color('red');
srw.set_font_face('Arial');
srw.set_font_size(12);
srw.set_font_weight(srw.bold_weight);
srw.set_font_style(srw.plain_style);
end if;

return (TRUE);
end;

HTH
Regards
Himanshu
Re: formating triggers [message #86427 is a reply to message #86407] Wed, 29 September 2004 02:35 Go to previous messageGo to next message
shish mate
Messages: 49
Registered: February 2004
Member
hi Himanshu
i tryed u'r codebut sys is giveing me error set_text_color (for alli.e font face etc) must be decl. and when i was searching in help the ve given code like this

function my_formtrig return BOOLEAN is
begin
if :bal < 0 then
srw.attr.mask := SRW.BORDERWIDTH_ATTR;
srw.attr.borderwidth := 1;
srw.set_attr (0, srw.attr);
end if;
return (true);
end;

and if i use this code he shows me only three rec on three pages and give error
report can not be formatted object 'vertically can never fit with in f_empno

is there is ant seting need to be set tell me briff ly yar i'll be thankfuul to u
ppllllllzzzzzzz help me

rep buld .ver 3.0.4.6.3
Re: formating triggers [message #86428 is a reply to message #86427] Wed, 29 September 2004 04:41 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Dear Ashish,
The code which I gave you is tested on Reports 6i ,so I do not know if it works with Reports 3.0 or not.

Anyways I also tested your code and also added more things to it & it works fine.

function F_empnoFormatTrigger return boolean is
begin

-- Automatically Generated from Report Builder.
if (:empno > '100')
then
SRW.ATTR.MASK := SRW.WEIGHT_ATTR + SRW.FACE_ATTR +SRW.BORDERWIDTH_ATTR + SRW.FBCOLOR_ATTR +SRW.BORDPATT_ATTR;
SRW.ATTR.WEIGHT := SRW.BOLD_WEIGHT;
SRW.ATTR.FACE := 'helvetica';
SRW.ATTR.BORDERWIDTH := 150;
SRW.ATTR.FBCOLOR := 'BLACK';
SRW.ATTR.BORDPATT := 'SOLID';
SRW.SET_ATTR (0,SRW.ATTR);
end if;

return (TRUE);
end;

Please check your report's layout propeties as the Problem lies in there.

HTH
Regards
Himanshu
Re: formating triggers [message #86433 is a reply to message #86428] Wed, 29 September 2004 20:03 Go to previous message
ashish
Messages: 107
Registered: December 2000
Senior Member
thanks Himanshu
i tryed u'r code it's working but only problem is
SRW.SET_ATTR (0,SRW.ATTR); if i enable this line it gives me error can u tell me what is the use off this field
thanks once again
ASHish
Previous Topic: log files for forms 10g
Next Topic: about faq's
Goto Forum:
  


Current Time: Mon Sep 09 20:47:57 CDT 2024